|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-10-26 18:52 UTC] melfar at gmail dot com
[2009-10-26 18:52 UTC] melfar at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 01:00:02 2025 UTC |
Description: ------------ PHP parser doesn't allow for array index operation to be used on a result of a function call. I propose a patch to allow such a construction. Reproduce code: --------------- <?php function car_brands() { return array("chevy", "hummer"); } print car_brands()[1] . "\n"; ?> Expected result: ---------------- "hummer" Actual result: -------------- Parse error: syntax error, unexpected '[' in test.php on line 5