Is it possible to use C++ binaries from php

前端 未结 8 1931
囚心锁ツ
囚心锁ツ 2020-12-01 08:00

Is it possible to write some C or C++ code and compile to binaries, then use those binaries with php? Is it also possible to write a php library using C and C++ ?

If

8条回答
  •  我在风中等你
    2020-12-01 08:56

    PHP is modular in design -- it consists of the "engine" and many extensions, some of which are essential (e.g. the "standard" extension) and some are optional. They can be compiled-in or loaded dynamically (via php.ini settings or the dl() function).

    You can easily write your own PHP extension in C/C++, if you are willing to learn the API. Start with the documentation on how to "hack the Zend Engine".

提交回复
热议问题