ID:               43768
 Updated by:       [EMAIL PROTECTED]
 Reported By:      roan dot kattouw at home dot nl
-Status:           Open
+Status:           Bogus
 Bug Type:         Scripting Engine problem
 Operating System: any
 PHP Version:      5.2.5
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

See http://bugs.php.net/bug.php?id=43577


Previous Comments:
------------------------------------------------------------------------

[2008-01-06 15:10:47] roan dot kattouw at home dot nl

Description:
------------
Any construct of the form myFunc()[x] or $object->myFunc()[x] results
in a fatal error, even if myFunc() returns an array. Putting the
expression in parentheses (like (myFunc())[x]) doesn't help. The only
remedy seems to be using an intermediate variable.

Reproduce code:
---------------
<?php
function getArray() { return array(1, 2, 3); }

echo getArray()[1];
?>

Expected result:
----------------
"2" being output

Actual result:
--------------
Parse error: syntax error, unexpected '[', expecting ',' or ';' in
test.php on line 4


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=43768&edit=1

Reply via email to