Re: [PHP-DEV] [Concept] Flip relative function lookup order (global, then local)

2024-08-20 Thread Levi Morrison
On Tue, Aug 20, 2024 at 8:26 PM Christian Schneider wrote: > > Am 20.08.2024 um 17:14 schrieb Levi Morrison : > > Keep in mind that qualifying > > every global function is annoying but probably can be somewhat > > automated, and will bring better performance. So again, this improves > > the existi

Re: [PHP-DEV] State of Generics and Collections

2024-08-20 Thread Jordan LeDoux
On Tue, Aug 20, 2024 at 6:02 AM Arnaud Le Blanc wrote: > Hi Bob, > > On Tue, Aug 20, 2024 at 12:18 AM Bob Weinand wrote: > > The fluid Arrays section says "A PoC has been implemented, but the > performance impact is still uncertain". Where may I find that PoC for my > curiosity? I'm imagining th

Re: [PHP-DEV] [Concept] Flip relative function lookup order (global, then local)

2024-08-20 Thread Christian Schneider
Am 20.08.2024 um 17:14 schrieb Levi Morrison : > Keep in mind that qualifying > every global function is annoying but probably can be somewhat > automated, and will bring better performance. So again, this improves > the existing code even without upgrading. Just to be sure: Would code *not* using

Re: [PHP-DEV] State of Generics and Collections

2024-08-20 Thread Bob Weinand
Hey Arnauld, On 20.8.2024 15:01:28, Arnaud Le Blanc wrote: Hi Bob, On Tue, Aug 20, 2024 at 12:18 AM Bob Weinand wrote: The fluid Arrays section says "A PoC has been implemented, but the performance impact is still uncertain". Where may I find that PoC for my curiosity? I'm imagining the impl

Re: [PHP-DEV] function autoloading v4 RFC

2024-08-20 Thread Rob Landers
On Mon, Aug 19, 2024, at 20:28, Mel Dafert wrote: > On August 15, 2024 5:22:51 PM GMT+02:00, Rob Landers > 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 > >seve

Re: [PHP-DEV] function autoloading v4 RFC

2024-08-20 Thread Rob Landers
On Wed, Aug 21, 2024, at 01:53, Matthew Weier O'Phinney wrote: > > > On Tue, Aug 20, 2024, 4:56 PM Rob Landers wrote: >> __ >> >> >> On Tue, Aug 20, 2024, at 18:07, Rob Landers wrote: >>> On Tue, Aug 20, 2024, at 08:50, Rowan Tommins [IMSoP] wrote: On 20 August 2024 00:21:22

Re: [PHP-DEV] function autoloading v4 RFC

2024-08-20 Thread Matthew Weier O'Phinney
On Tue, Aug 20, 2024, 4:56 PM Rob Landers wrote: > > > On Tue, Aug 20, 2024, at 18:07, Rob Landers wrote: > > On Tue, Aug 20, 2024, at 08:50, Rowan Tommins [IMSoP] wrote: > > > > On 20 August 2024 00:21:22 BST, Rob Landers wrote: > > > >I assume you are worried about something like this passing

Re: [PHP-DEV] [Concept] Flip relative function lookup order (global, then local)

2024-08-20 Thread Rob Landers
On Tue, Aug 20, 2024, at 23:56, Faizan Akram Dar wrote: > > > On Tue, Aug 20, 2024 at 11:34 PM Ilija Tovilo wrote: >> Hi Levi >> >> On Tue, Aug 20, 2024 at 5:14 PM Levi Morrison >> wrote: >> > >> > I have long been in favor of a larger BC break with better language >> > consistency. Class look

Re: [PHP-DEV] [Concept] Flip relative function lookup order (global, then local)

2024-08-20 Thread Faizan Akram Dar
On Tue, Aug 20, 2024 at 11:34 PM Ilija Tovilo wrote: > Hi Levi > > On Tue, Aug 20, 2024 at 5:14 PM Levi Morrison > wrote: > > > > I have long been in favor of a larger BC break with better language > > consistency. Class lookup and function lookup with respect to > > namespaces should be treated

Re: [PHP-DEV] function autoloading v4 RFC

2024-08-20 Thread Rob Landers
On Tue, Aug 20, 2024, at 18:07, Rob Landers wrote: > On Tue, Aug 20, 2024, at 08:50, Rowan Tommins [IMSoP] wrote: >> >> >> On 20 August 2024 00:21:22 BST, Rob Landers wrote: >> > >> >I assume you are worried about something like this passing test? >> > >> >--TEST-- >> >show called only once >>

Re: [PHP-DEV] [Concept] Flip relative function lookup order (global, then local)

2024-08-20 Thread Ilija Tovilo
Hi Levi On Tue, Aug 20, 2024 at 5:14 PM Levi Morrison wrote: > > I have long been in favor of a larger BC break with better language > consistency. Class lookup and function lookup with respect to > namespaces should be treated the same. The difficulty is getting a > majority of people to vote ye

Re: [PHP-DEV] function autoloading v4 RFC

2024-08-20 Thread Rob Landers
On Tue, Aug 20, 2024, at 08:50, Rowan Tommins [IMSoP] wrote: > > > On 20 August 2024 00:21:22 BST, Rob Landers wrote: > > > >I assume you are worried about something like this passing test? > > > >--TEST-- > >show called only once > >--FILE-- > > > > >namespace test; > > > >spl_autoload_register

Re: [PHP-DEV] [Concept] Flip relative function lookup order (global, then local)

2024-08-20 Thread Levi Morrison
> To sum up, I think we need to remove the fallback behavior, so we can have > better things in the future. > Either keep only local with a bigger BC break but a better language > consistency. > Or keep only global with a smaller BC break. I have long been in favor of a larger BC break with bett

Re: [PHP-DEV] State of Generics and Collections

2024-08-20 Thread Arnaud Le Blanc
Hi Larry, On Tue, Aug 20, 2024 at 3:32 AM Larry Garfield wrote: > > In fact, generic traits (essentially statically replacing the generic > > arguments at link-time) would be an useful feature which would remain > > useful even if we had fully reified generics. > > I recognize that some functiona

Re: [PHP-DEV] State of Generics and Collections

2024-08-20 Thread Arnaud Le Blanc
Hi Mike, On Tue, Aug 20, 2024 at 2:45 AM Mike Schinkel wrote: > It seems Java-style Generics are viewed as the proper archetype for Generics > in PHP? I would challenge the wisdom of taking that road considering how > different the compilers and runtimes are between the Java and PHP. PHP > s

Re: [PHP-DEV] State of Generics and Collections

2024-08-20 Thread Arnaud Le Blanc
Hi Bob, On Tue, Aug 20, 2024 at 12:18 AM Bob Weinand wrote: > The fluid Arrays section says "A PoC has been implemented, but the > performance impact is still uncertain". Where may I find that PoC for my > curiosity? I'm imagining the implementation of the array types as a counted > collection

Re: [PHP-DEV] State of Generics and Collections

2024-08-20 Thread Rob Landers
On Tue, Aug 20, 2024, at 14:08, Arnaud Le Blanc wrote: > Hi Rob, > > On Mon, Aug 19, 2024 at 7:51 PM Rob Landers wrote: > > > > Invariance would make arrays very difficult to adopt, as a library can > > > not start type hinting generic arrays without breaking user code, and > > > users can n

Re: [PHP-DEV] State of Generics and Collections

2024-08-20 Thread Arnaud Le Blanc
Hi Rob, On Mon, Aug 19, 2024 at 7:51 PM Rob Landers wrote: > > Invariance would make arrays very difficult to adopt, as a library can not > > start type hinting generic arrays without breaking user code, and users can > > not pass generic arrays to libraries until they start using generic arra

Re: [PHP-DEV] [Concept] Flip relative function lookup order (global, then local)

2024-08-20 Thread Rob Landers
On Tue, Aug 20, 2024, at 10:41, Nick Lockheart wrote: > > > We would upgrade that to a warning in PHP 9.2, and it would end up > > being an error on PHP 10 and have a BC break. > > > > I don't think adding a \ to each function call is ugly, that's what > > we have for classes, and it works fine

Re: [PHP-DEV] [Concept] Flip relative function lookup order (global, then local)

2024-08-20 Thread Nick Lockheart
> We would upgrade that to a warning in PHP 9.2, and it would end up > being an error on PHP 10 and have a BC break. > > I don't think adding a \ to each function call is ugly, that's what > we have for classes, and it works fine; or an use statement. > > So, why do we think that after people g

Re: [PHP-DEV] [Concept] Flip relative function lookup order (global, then local)

2024-08-20 Thread Alexandru Pătrănescu
On Sun, Aug 4, 2024 at 8:43 PM Ilija Tovilo wrote: > Hi Rob > > On Fri, Aug 2, 2024 at 7:10 PM Rob Landers wrote: > > > > So, what you’re saying is that symfony and laravel can get a performance > increase by simply adding a \ in the right places? Why don’t they do that > instead of changing the

Re: [PHP-DEV] State of Generics and Collections

2024-08-20 Thread Rob Landers
On Tue, Aug 20, 2024, at 03:53, Bob Weinand wrote: > On 20.8.2024 03:31:05, Larry Garfield wrote: >> On Mon, Aug 19, 2024, at 5:16 PM, Bob Weinand wrote: >> >> >>> Regarding the Collections PR, I personally really don't like it: >>> >>> • It implements something which would be trivial if we h