Hi,
PCS provides a fast and easy mechanism to mix C and PHP code in PHP
extensions (more about PCS at http://pcs.tekwire.net). Thanks to the PHP
7 performance improvement and the inclusion of opcache in the core, a
lot of existing non-performance-critical extension code may now be
converted to PHP without significant performance loss (this must be
measured case by case, of course, but tests show that opcode-cached PHP
code is often faster than C).
Another motivation is the lack of extension maintainers. It may be
complex to convert a C extension to PHP but, once it's done, maintenance
becomes much easier.
As one of PCS goals is to allow converting parts of existing core
extensions to PHP, it seems natural to initiate the movement by an
inclusion of PCS in the core distribution. Then, I and others will start
proposing conversions of existing code. IMO, the PDO generic layer is a
perfect candidate, but there are many others.
Converting existing C code to PHP is not the only usage. With PCS,
adding an OO layer to a function-only extension becomes an easy task.
Sara recently told about a curl OOP layer
(https://gist.github.com/sgolemon/e95bfc34d34c4f63fa953ee9294ae02c).
Using PCS, adding such PHP code on top of the curl extension would take
less than one hour.
I hadn't proposed this so far because the 'cache_key' operation
currently proposed for 7.2 is a pre-requisite, as PCS exposes the PHP
code it manages via a stream wrapper.
So, please give me your thoughts. Suggestions of potential candidates to
be rewritten from C to PHP are welcome too.
Regards
François
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php