Req #49103 [Opn->Csd]: Use array return value of function as array

From: Date: Wed, 24 Nov 2010 14:10:46 +0000
Subject: Req #49103 [Opn->Csd]: Use array return value of function as array
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-156391@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=49103&edit=1 ID: 49103 Updated by: jani@php.net Reported by: Mathias dot Slawik at matzelworkz dot de Summary: Use array return value of function as array -Status: Open +Status: Closed Type: Feature/Change Request -Package: Feature/Change Request +Package: *General Issues Operating System: All PHP Version: 5.3.0 -Assigned To: +Assigned To: jani Block user comment: N Private report: N New Comment: Array dereferencing has been added in trunk. Next release from that (maybe 5.4.0 or something else :) has it. :) Previous Comments: ------------------------------------------------------------------------ [2009-07-29 21:51:50] Mathias dot Slawik at matzelworkz dot de Description: ------------ There is no syntax to use an array return value of a function directly as array. Reproduce code: --------------- function foo() { return array("bar", "baz"); } print foo()[0]; Expected result: ---------------- bar Actual result: -------------- Parse error: parse error on line 5 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=49103&edit=1

« previous php.bugs (#156391) next »