|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-12-06 17:47 UTC] nikic@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: nikic
[2012-12-06 17:47 UTC] nikic@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 12 09:00:01 2025 UTC |
Description: ------------ When calling function which returns array and try to get element of the returned array directly, without copying the result into variable like "foo()[x]" where x is integer, it returns parse syntax error. However this is working in 5.4.* versions. Test script: --------------- <?php function returnArray() { $arr = array("first", "second", "third"); return $arr; } echo returnArray()[1]; ?> Expected result: ---------------- second Actual result: -------------- Parse error: syntax error, unexpected '[', expecting ',' or ';'