Edit report at https://bugs.php.net/bug.php?id=51672&edit=1
ID: 51672
Comment by: nmn at mailinator dot com
Reported by: miklcct at gmail dot com
Summary: Parse error when a subscript operator is used after
a function call operator
Status: Bogus
Type: Bug
Package: Compile Failure
Operating System: Ubuntu 9.04
PHP Version: 5.3.2
Block user comment: N
Private report: N
New Comment:
Not a bug, just a stupid feature that demonstrate the lack of vision in the
language design.
Previous Comments:
------------------------------------------------------------------------
[2010-04-27 12:14:50] [email protected]
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
------------------------------------------------------------------------
[2010-04-27 12:11:21] miklcct at gmail dot com
Description:
------------
syntax error when a subscript operator is used with a function call operator
Test script:
---------------
#!/usr/bin/php
<?php
function test() {
return "foo";
}
echo test()[0];
Expected result:
----------------
f
Actual result:
--------------
Parse error: syntax error, unexpected '[', expecting ',' or ';' in
/home/www/bus/test.php on line 8
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=51672&edit=1