php.net |  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
Votes:1
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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: bugzilla77 at gmail dot com
New email:
PHP Version: OS:

 

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

Test script:
---------------
<?php
 $a=[0];

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

 print_r($a);
?>

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

Patches

Pull Requests

History

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] requinix@php.net
-Status: Open +Status: Suspended
 [2019-12-23 16:44 UTC] requinix@php.net
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: https://wiki.php.net/rfc/howto
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 01 17:01:34 2025 UTC