Req #79020 [Opn->Sus]: Fast array push $a[]=...[1,2];

From: Date: Mon, 23 Dec 2019 16:44:02 +0000
Subject: Req #79020 [Opn->Sus]: Fast array push $a[]=...[1,2];
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-224499@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 Updated by: requinix@php.net Reported by: bugzilla77 at gmail dot com Summary: Fast array push $a[]=...[1,2]; -Status: Open +Status: Suspended 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 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 Previous Comments: ------------------------------------------------------------------------ [2019-12-23 09:43:31] 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 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

« previous php.bugs (#224499) next »