Bug #60405 [Opn->Bgs]: Array dereferencing support do not work
| From: | felipe@php.net | Date: | Tue, 29 Nov 2011 11:34:27 +0000 |
| Subject: | Bug #60405 [Opn->Bgs]: Array dereferencing support do not work | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-165548@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=60405&edit=1
ID: 60405
Updated by: felipe@php.net
Reported by: bugzilla33 at gmail dot com
Summary: Array dereferencing support do not work
-Status: Open
+Status: Bogus
Type: Bug
Package: Scripting Engine problem
Operating System: All
PHP Version: 5.4.0RC2
Block user comment: N
Private report: N
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
It's not supposed to work in the 'array()' language constructor. (i.e. it isn't
a function)
Previous Comments:
------------------------------------------------------------------------
[2011-11-29 11:00:27] bugzilla33 at gmail dot com
<?php
$i=0;
print(array('pass')[$i]);
print(['pass'][$i]);
?>
------------------------------------------------------------------------
[2011-11-29 10:30:24] bugzilla33 at gmail dot com
Package: Compile failure -> Scripting Engine problem
------------------------------------------------------------------------
[2011-11-29 10:03:55] bugzilla33 at gmail dot com
Description:
------------
Array dereferencing support do not work.
Test script:
---------------
<?php
print(array('pass')[0]);
print(['pass'][0]);
?>
Expected result:
----------------
passpass
Actual result:
--------------
Parse error: syntax error, unexpected '[' in C:\htdocs\test.pl\1.php on line 2
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=60405&edit=1