Re: Constructor object instance dereferentiation

From: Date: Sun, 22 May 2011 08:16:34 +0000
Subject: Re: Constructor object instance dereferentiation
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-52499@lists.php.net to get a copy of this message
On Sun, May 22, 2011 at 6:18 AM, dukeofgaming <dukeofgaming@gmail.com>wrote: > Hi, > > I was wondering if object dereferentiation after constructor call is > something that has been discussed already. This is, being able to do > something like: > > new MyClass()->setSomething(); > > Instead of: > > $var = new MyClass(); > $var->setSomething(); > > Regards, > > David Vega > hi. it was already discussion, Felipe created an RFC and a patch, the responses was all positive, so I think if nobody changed their mind, we could move this from Under Discussion to Accepted/Implemented as I said before, it would be in good pair with the already implemented array dereferencing (https://wiki.php.net/rfc/functionarraydereferencing) http://marc.info/?l=php-internals&m=129080024516125&w=2 https://wiki.php.net/rfc/instance-method-call Tyrael

« previous php.internals (#52499) next »