|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-09-20 14:28 UTC] tony2001@php.net
[2005-09-20 14:28 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 18:00:01 2025 UTC |
Description: ------------ When using an indexer on a return value of a function, the compiler returns an error: parse error, unexpected '[' I would expect it to compile as it would be a valid expression. Reproduce code: --------------- Does not compile: <?php print test()['test']; function test() { return array('test'=>1); } ?> Does compile: <?php $tmp = test(); print $tmp['test']; function test() { return array('test'=>1); } ?> Expected result: ---------------- Actual result: -------------- PHP Parse error: parse error, unexpected '[' in test.php on line 2