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

From: Date: Fri, 23 Aug 2024 13:20:55 +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 internals+get-125140@lists.php.net to get a copy of this message
On Fri, 23 Aug 2024, at 13:43, Stephen Reay wrote: > This change would also break existing code that does "the right thing", > and has the potential to arbitrarily break perfectly valid userland > code *any time a new global function is added*, forever. You replied to me, but you seem to be commenting on one of the other proposals. My preference is for "unqualified = global", which is a one-off breaking change, which only affects user-defined functions, which are declared in a namespace, and used in that same namespace. You're right that it would mean classes and functions resolve differently, and that's why I said that if I had a time machine, I would support a different option. But, personally, I don't think the small long-term inconsistency outweighs the huge short-term disruption of defaulting to local. Regards, -- Rowan Tommins [IMSoP]

« previous php.internals (#125140) next »