ID: 50004
User updated by: melfar at gmail dot com
Reported By: melfar at gmail dot com
-Status: Open
+Status: Closed
Bug Type: Feature/Change Request
Operating System: agnostic
PHP Version: 5.3.0
New Comment:
Duplicate of bug 50003
Previous Comments:
------------------------------------------------------------------------
[2009-10-26 18:45:42] melfar at gmail dot com
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
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=50004&edit=1