On Fri, Aug 23, 2024 at 8:11 PM Stephen Reay <php-li...@koalephant.com> wrote: > > On 24 Aug 2024, at 00:32, Ilija Tovilo <tovilo.il...@gmail.com> wrote: > > > I obviously also disagree with 3. as I wouldn't have sent this > > proposal otherwise. :) Performance improvements are hard to come by > > nowadays. It was measured on real codebases (Symfony and Laravel). > > Just to make sure I'm not misunderstanding something here - Symphony and > Laravel (or anyone else) can get the exact same performance benefit you're > talking about, if they use either a leafing `\` or `use function...` in their > own code, today, correct?
As I wrote in my e-mail: > For some context: Before proposing this change, I asked Symfony if > they were interested in disambiguating calls to improve performance, > given I did some work to make fully qualified calls faster. But they > were not, stating that the change would be too verbose for their > liking. > > Making unqualified calls to mean local would force Symfony into making > the change, which is not the approach I'm interested in taking. Yes, the full performance benefits can be achieved by prefixing your entire codebase, which includes not only your own code but also the code of your framework. How much you benefit from just converting your own code of course depends on how much you rely on vendor code. > I'm not going to pretend to know how many files either project has that uses > global functions, but neither of those two existing options seems > particularly "hard to come by" in my mind. The "hard to come by" part is referring to the engine, which is quite optimized for the current semantics. Some of PHPs quirky semantics make it hard to improve it further, this being one of them.