#41277 [Opn->Bgs]: Parse error when getting an array element after function call
| From: | derick@php.net | Date: | Fri, 04 May 2007 06:35:42 +0000 |
| Subject: | #41277 [Opn->Bgs]: Parse error when getting an array element after function call | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-112222@lists.php.net to get a copy of this message | ||
ID: 41277
Updated by: derick@php.net
Reported By: furax at yandex dot ru
-Status: Open
+Status: Bogus
Bug Type: Compile Failure
Operating System: Windows
PHP Version: 5.2.2
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
.
Previous Comments:
------------------------------------------------------------------------
[2007-05-04 06:33:42] furax at yandex dot ru
Description:
------------
I've tried to get an element of array, returned by function getArray()
(user-defined).
Reproduce code:
---------------
<?php
function getArray()
{
return array('Useful data', 'Some useless data');
}
$data=getArray()[0];
?>
Expected result:
----------------
$data='Useful data'
Actual result:
--------------
Parse error: syntax error, unexpected '[' in Z:\home\test\www\bad1.php5
on line 7
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41277&edit=1