Hey Nick,
On Sun, 4 Aug 2024 at 13:42, Nick Lockheart <[email protected]> wrote:
> This also prevents the parser from using dedicated opcodes for built-in
> functions.
>
> This incurs a performance penalty.
>
For many, many years, tools like doctrine/coding-standard
have imported
global functions.
The performance benefit is minimal and opt-in at very minimal effort for
userland (literally "run a decent coding standards tool").
Changing this behavior breaks use-cases like shadowing internal functions,
which are useful for testing / stubbing / etc. I disagree with the
technique, but it is a valid and relied-upon use-case nonetheless.
Better ways forward:
* endorse userland to use a CS tool
* namespace performance-sensitive PHP functions, so we can exclude the
entire problem, by having people use the namespaced variant :P
Marco Pivetta
https://mastodon.social/@ocramius
https://ocramius.github.io/