Re: Proposing inclusion of PCS in the 7.2 core distribution
| From: | Dennis Birkholz | Date: | Tue, 06 Jun 2017 15:52:14 +0000 |
| Subject: | Re: Proposing inclusion of PCS in the 7.2 core distribution | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-99403@lists.php.net to get a copy of this message | ||
Hi together,
Am 06.06.2017 um 14:43 schrieb Nikita Popov:
> First of all: I think the ability to implement parts of PHP extensions in
> PHP is extremely important and will be a game changer in our ability to
> maintain and improve our standard library.
I agree with you here 100%.
> 1. As far as I understand, PCS relies on autoloading. There are two issues
> here: First, autoloading does not register symbols prior to autoloading.
> This means that functions like get_defined_classes() will not behave as
> expected. Second, autoloading does not support functions. I think both of
> these problems can be solved with some up-front symbol analysis. Lazily
> compiling internal functions should not run into any of the problems we
> have with userland function autoloading.
(disclaimer: I have not deep knowledge how the core really works)
From what I see there is a difference between writing extension code in
PHP and placing that plain PHP files somewhere when installing. So I
would argue when compiling the extension or the core, all these PHP
extension stuff should get compiled to OpCodes and put in a segment of
the resulting binary.
The OpCache could then be modified to allow it to use the OpCodes from
these read-only segments (one for the core, one optionally for each
extension). That would void the problems you mentioned above, but maybe
I am missing how the OpCache and symbol registration work in PHP.
Greets
Dennis