Zend引擎可以在PHP之外嵌入吗? [英] Is the Zend engine embeddable outside of PHP?

查看:133
本文介绍了Zend引擎可以在PHP之外嵌入吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我记得,Zend引擎的原始设计之一是它相对容易嵌入到可能希望创建的其他语言中.基本上,PHP语法不包含所有PHP模块.还是这样吗?

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?

推荐答案

Zend Engine本质上是一个虚拟机,可以解释PHP字节码.基本上,您要做的是为一种语言和一个编译器创建一个解析器,并将其编译为PHP字节码,因此它可以由Zend Engine执行.

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.

现在我敢打赌,这并不像听起来那么容易.我认为Zend Engine与PHP紧密集成在一起并将其分开,因此执行您自己的字节码可能会很麻烦.

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.

希望这会有所帮助.

这篇关于Zend引擎可以在PHP之外嵌入吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆