array(...)[]

From: Date: Sun, 17 Oct 2004 14:39:55 +0000
Subject: array(...)[]
Groups: php.internals 
Request: Send a blank email to internals+get-13363@lists.php.net to get a copy of this message
Hi, I've just seen that finally it's possible to do "$object->getOtherObject()->doSomething()" with PHP5 which was not possible in PHP4. But I wonder why something like this still does not work: $object->returnArray()[$index] returnArray()[$index] array(1,2,3,4)[$index] It would be really cool if a future version of PHP understands the above syntax because currently it's really annoying to access an array element returned from a method/function because the return value must be stored in a temporary variable before it is possible to access elements from that array. Bye K

« previous php.internals (#13363) next »