|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #79020 Fast array push $a[]=...[1,2];
Submitted: 2019-12-23 09:29 UTC Modified: 2019-12-23 16:44 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: bugzilla77 at gmail dot com Assigned:
Status: Suspended Package: *General Issues
PHP Version: 7.4.1 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: bugzilla77 at gmail dot com
New email:
PHP Version: OS:


 [2019-12-23 09:29 UTC] bugzilla77 at gmail dot com
Fast array push $a[]=...[1,2];

Test script:

 $a[]=...[1,2]; // array_push($a,...[1,2]);


Expected result:
Array ( [0] => 0 [1] => 1 [2] => 2 )

Actual result:
Parse error: syntax error, unexpected '...' (T_ELLIPSIS) in C:\htdocs\wwwroot\fast_array_push.php on line 4


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2019-12-23 09:43 UTC] bugzilla77 at gmail dot com
$a[]=$b is equal to array_push($a,$b)
$a[]=...$b should be equal to array_push($a,...$b)
 [2019-12-23 16:44 UTC]
-Status: Open +Status: Suspended
 [2019-12-23 16:44 UTC]
A syntax change like this requires a discussion on the internals mailing list and an RFC. You can find out more about the process on the PHP wiki:
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Thu Dec 03 14:01:27 2020 UTC