On Thursday, 15 August 2024 at 17:22, Rob Landers <rob@bottled.codes> wrote:
> Hello internals, > > I've decided to attempt an RFC for function autoloading. After reading > hundreds of ancient (and recent) emails relating to the topic along with > several abandoned RFCs from the past, and after much review, I've decided to > put forth a variation of a previous RFC, as it seemed the least ambitious and > the most likely to work: > > https://wiki.php.net/rfc/function_autoloading4 > > Please let me know what you think. An implementation should be along before > opening it for a vote (now that I realize how important that is). I had a quick glance at the RFC, and I really don't think this is a good approach or good API. Having autoloading in SPL causes dumb issues, for example ext/session must register it has a dependency on ext/spl just for the autoloader. [1] This means that currently ext/session depends on ext/spl, ext/spl depends on ext/standard, and ext/standard depends on ext/session, a glorious circular dependency. This main problem has pushed me again to rebase my PR [2] for the Core Autoloading RFC. [3] The wording of the RFC hasn't been updated, as this is frankly my least favourite part of any RFC. The PR passes CI and has also produced benchmark results from CI. [4] I would rather have some collaboration on a proper solution than, IMHO, this suboptimal solution. I still need to get opinions from other people if it makes sense to remove the zend_autoload_class function pointer API and have the VM directly call zend_autoload. Because from what I remember 2 years ago, some profiling tools hook into it to track autoloading time. This might be improved by introducing new observer hooks. Best regards, Gina P. Banyard > [1] https://github.com/php/php-src/pull/14544#issuecomment-2294907817 [2] https://github.com/php/php-src/pull/8294 [3] https://wiki.php.net/rfc/core-autoloading [4] https://github.com/php/php-src/actions/runs/10441267948