Is the Zend engine embeddable outside of PHP?

橙三吉。 提交于 2019-12-07 08:00:52

问题


One of the original designs of the Zend engine, if I recall, was that it was to be relatively easy to embed for other languages one might wish to create. Basically, the PHP syntax without all the PHP modules. Is this still the case?


回答1:


Well, the Zend Engine is basically a Virtual Machine that interprets PHP bytecode. Basically what you would have to do is create a parser for a language and a compiler and have it compile it into PHP bytecode therefore it could be executed by the Zend Engine.

Now I bet this isn't as easy as it sounds. I think the Zend Engine is pretty tightly intergrated with PHP and seperating it so it would execute your own bytecode could be quite a hassle.

Hope this helps.



来源:https://stackoverflow.com/questions/2015072/is-the-zend-engine-embeddable-outside-of-php

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!