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

From: Date: Fri, 23 Aug 2024 00:42:38 +0000
Subject: Re: [Concept] Flip relative function lookup order (global, then local)
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message

> 
> BUT, if people already complain about "\" being ugly, having to write
> "namespace\" is going to make them REALLY grumpy...
> So maybe at the same time (or, probably, in advance) we need to come
> up with a nicer syntax for explicitly referencing the current
> namespace.
> Unfortunately, finding unused syntax is hard, which is why we have
> "\" in the first place (and for the record, I think it works just
> fine), but maybe something like "_\" could work? Giving us:
> namespace Foo;
> $native_length = strlen('hello'); # same as \strlen('hello')
>  $foo_length = _\strlen('hello'); #  same as \Foo\strlen('hello')
> 


    namespace foo using global functions;

 - or - 

    namespace foo using local functions;


Tell PHP what you want at the per-file level.


Thread (112 messages)

« previous php.internals (#125105) next »