php.net |  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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: bugzilla33 at gmail dot com
New email:
PHP Version: OS:

 

 [2011-11-29 13:13 UTC] bugzilla33 at gmail dot com
Description:
------------
Please add array element access on instantiation

...like JavaScript, C# and all languages excluding PHP 5.4RC

Test script:
---------------
<?php

 $i=0;
 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:
--------------
pass

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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

Thanks.
 [2011-11-29 13:22 UTC] felipe@php.net
-Summary: Array element access on instantiation +Summary: Hidden because of SPAM -Status: Spam +Status: Open
 [2011-11-29 13:22 UTC] felipe@php.net
-Status: Open +Status: Bogus
 [2011-11-29 13:22 UTC] felipe@php.net
,
 [2011-11-29 13:23 UTC] felipe@php.net
-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