Call object reference and member function in 1 step

From: Date: Sun, 12 Oct 2003 18:49:33 +0000
Subject: Call object reference and member function in 1 step
Groups: php.general 
Request: Send a blank email to php-general+get-165917@lists.php.net to get a copy of this message
I'm reading the References Explained section of php doc, and am a little confused on the Returning References section. I was wondering why you cannot get a reference to an object and call a member function all in one step like so: $result=(&$bar->getObj())->foo(); I've tried this in code, and get a parse error.

« previous php.general (#165917) next »