Re: [RFC] Treat namespaced names as single token, relax reserved keyword restrictions

From: Date: Thu, 16 Jul 2020 15:30:25 +0000
Subject: Re: [RFC] Treat namespaced names as single token, relax reserved keyword restrictions
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-111050@lists.php.net to get a copy of this message
> On Jul 15, 2020, at 3:26 AM, Nikita Popov <nikita.ppv@gmail.com> wrote: > > On Tue, Jul 14, 2020 at 5:37 PM Josh Bruce <josh@joshbruce.dev > <mailto:josh@joshbruce.dev>> wrote: > New to the discussion and being this deep; so, apologies for any bumps. Mainly questions. > > Does this only affect the string after the “namespace” keyword (make implicit explicit)? > > This affects any place accepting namespaced names. The only part that is specific to the > "namespace" keyword is that you can write "namespace reserved_keyword;", which > would not automatically be the case based on the rest of the proposal. > > So, things like “use” with a stack of classes within a base namespace would still be > possible? > > You mean the group use syntax "use Foo\Bar\{A, B};"? That's still possible. In > this case we'd interpret Foo\Bar" as a namespaced name and "\" as an isolated > namespace separator. This is the only case where "\" is still used as an independent > symbol. > > On reserved words, if I had class “String” would that still throw a reserved word > violation? > > Yes, nothing about handling of reserved class names is changing under the current proposal. > > Nikita Got it. Thanks Nikita! Much appreciated and could have a fair amount of benefit on both sides of the equation (dev and PHP). Cheers, Josh

« previous php.internals (#111050) next »