|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60409 Array element access on instantiation
Submitted: 2011-11-29 13:13 UTC Modified: 2011-11-29 13:23 UTC
From: bugzilla33 at gmail dot com Assigned:
Status: Not a bug Package: Arrays related
PHP Version: 5.4.0RC2 OS: All
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: bugzilla33 at gmail dot com
New email:
PHP Version: OS:


 [2011-11-29 13:13 UTC] bugzilla33 at gmail dot com
Please add array element access on instantiation JavaScript, C# and all languages excluding PHP 5.4RC

Test script:

 print(array('pa','th')[$i++]); // pa
 print(['wa','ss'][$i++]); // ss


Expected result:
Parse error: syntax error, unexpected '[' in C:\htdocs\array.php on line 4

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-11-29 13:21 UTC]
-Status: Open +Status: Spam
 [2011-11-29 13:21 UTC]
Please, stop posting same thing everytime. We already have your feature request at #60408.

 [2011-11-29 13:22 UTC]
-Summary: Array element access on instantiation +Summary: Hidden because of SPAM -Status: Spam +Status: Open
 [2011-11-29 13:22 UTC]
-Status: Open +Status: Bogus
 [2011-11-29 13:22 UTC]
 [2011-11-29 13:23 UTC]
-Summary: Hidden because of SPAM +Summary: Array element access on instantiation
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Oct 25 07:03:33 2021 UTC