Re: alpha2 scheduled

From: Date: Mon, 27 Oct 2008 18:19:43 +0000
Subject: Re: alpha2 scheduled
References: 1 2 3 4 5 6 7 8 9 10  Groups: php.internals 
Request: Send a blank email to internals+get-41475@lists.php.net to get a copy of this message
> $class = '\ foo \ bar \ baz'; In those cases i get why its an issue. But when i look at: namespace\class\method() against namespace \ class \ method() I get the feeling that \ is a pretty good solution. 2008/10/27 Johannes Schlüter <johannes@php.net>: > On Mon, 2008-10-27 at 17:53 +0100, Hannes Magnusson wrote: >> On Mon, Oct 27, 2008 at 16:50, Ólafur Waage <olafurw@gmail.com> wrote: >> > I found that he had one valid question that i would like to see answered. >> > >> >> is the below allowed ? >> >> >> >> $bar = new Module \ Foo \ Bar(); >> >> >> >> I find it easier to read than with out the space. >> > >> > Since it looks pretty good with the spaces there. >> >> I don't see why it wouldn't be allowed. You can already do >> function_name (), or classname :: methodname >> (). >> This isn't python, the parser doesn't really care about the spaces :) > > It might work in some places, not always, consider > <?php > $class = '\ foo \ bar \ baz'; > new $class(); > ?> > > as the name is stored without spaces in the class table, not sure > whether it's worth parsing whitespaces in such cases... > > johannes > > >

« previous php.internals (#41475) next »