Re: [RFC] Array Dereferencing

From: Date: Tue, 08 Jun 2010 10:41:21 +0000
Subject: Re: [RFC] Array Dereferencing
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-48685@lists.php.net to get a copy of this message
On Tue, 2010-06-08 at 12:23 +0200, Jacob Oettinger wrote: > Would it be equally simple to allow the syntax below? > > $result = new ResultMaker()->getIt(); does this mean $result = new (ResultMaker()->getIt()); or $result = (new ResultMaker())->getIt(); I assume the later, but that is non-obvious as we allow $result = new $class(); > and > > $resultOfFunc = returnsFunc()(); Having closures this might make sense. (While I don't want to debug code like $foo("bar")[42]->do()("it"); ) Oh and obviously +1 on the original patch. ;-) johannes

« previous php.internals (#48685) next »