Req #79020 [Opn]: Fast array push $a[]=...[1,2];
| From: | bugzilla77 at gmail dot com | Date: | Mon, 23 Dec 2019 09:43:31 +0000 |
| Subject: | Req #79020 [Opn]: Fast array push $a[]=...[1,2]; | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-224492@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=79020&edit=1
ID: 79020
User updated by: bugzilla77 at gmail dot com
Reported by: bugzilla77 at gmail dot com
Summary: Fast array push $a[]=...[1,2];
Status: Open
Type: Feature/Change Request
Package: *General Issues
Operating System: all
PHP Version: 7.4.1
Block user comment: N
Private report: N
New Comment:
$a[]=$b is equal to array_push($a,$b)
$a[]=...$b should be equal to array_push($a,...$b)
Previous Comments:
------------------------------------------------------------------------
[2019-12-23 09:29:41] 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
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=79020&edit=1