使用Hiphop进行PHP扩展开发 [英] Using Hiphop for PHP extension development
问题描述
Hiphop将PHP转换为C ++代码,有人用它进行PHP扩展开发吗?
Hiphop converts PHP into C++ code, did anyone used it for PHP extension development?
我发现以下链接可以使用C ++编写PHP扩展 http://devzone.zend.com/article /4486-在一个PHP扩展中包装C类
I have found following link to write PHP extensions using C++ http://devzone.zend.com/article/4486-Wrapping-C-Classes-in-a-PHP-Extension
我想编写一些PHP类并将其转换为C ++,并在PHP扩展中使用它.
I want to write some PHP classes and convert them into C++ and use it in PHP extension.
请让我知道是否有人这样做,也欢迎任何想法.
Please let me know if anyone did that and also any thoughts are welcomed.
推荐答案
据我所知,HipHop的重点是绕过PHP的称为Zend Engine的虚拟机.
As far as I know, the point of HipHop is to bypass PHP's Virtual Machine known as Zend Engine.
为了创建PHP扩展,您必须连接到Zend Engine.
In order to create a PHP extension, you have to hook into the Zend Engine.
因此,如果HipHop绕过ZE完成的执行,我不知道如何创建一个PHP类,该类将转换为C ++,然后再用于创建扩展.
So if HipHop bypasses the execution done by ZE, I don't see how it'd be possible to create a PHP class that gets translated to C++ one that would then be used to create an extension.
HipHop不会转换PHP 源代码,它会转换 BYTE 代码.如果是前者,那就是巨大的区别.是否需要使用另一种语言? :)
HipHop doesn't convert PHP source code, it converts the BYTE code. It's a huge difference, if it were the former.. would there be a need for using another language? :)
这篇关于使用Hiphop进行PHP扩展开发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!