Re: Allow empty property names

From: Date: Fri, 25 Mar 2016 23:00:32 +0000
Subject: Re: Allow empty property names
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-91957@lists.php.net to get a copy of this message
Hi Yasuo, On 25 March 2016 at 23:56, Yasuo Ohgaki <yohgaki@ohgaki.net> wrote: > Hi all, > > On Sat, Mar 26, 2016 at 5:31 AM, Marco Pivetta <ocramius@gmail.com> wrote: > > var_dump((object) ['' => 'foo']); > > var_dump((object) ["\0*\0" => 'foo']); > > var_dump((object) ["\0Foo\0" => 'foo']); > > Allowing null char would be too much. We reject null char in path > parameters, it should be rejected like path parameter. IMHO. > The sequence "\0*\0" means "protected property", while the sequence "\0Foo\0" means "private property of class Foo": that's been the case for a looooong time :-) Not suggesting allowing "\0" for property names: the example just shows creating a public, private and protected property with an empty name. Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/

« previous php.internals (#91957) next »