Bug #74052 [Opn->Csd]: Don't unbinding same arrays when copy $ar2=$ar; &...$ar; $ar2 related with $ar
| From: | nikic@php.net | Date: | Mon, 06 Feb 2017 14:51:01 +0000 |
| Subject: | Bug #74052 [Opn->Csd]: Don't unbinding same arrays when copy $ar2=$ar; &...$ar; $ar2 related with $ar | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-207203@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74052&edit=1
ID: 74052
Updated by: nikic@php.net
Reported by: vitall at ua dot fm
Summary: Don't unbinding same arrays when copy $ar2=$ar;
&...$ar; $ar2 related with $ar
-Status: Open
+Status: Closed
Type: Bug
Package: Arrays related
Operating System: Windows 7
PHP Version: 5.6.30
-Assigned To:
+Assigned To: nikic
Block user comment: N
Private report: N
New Comment:
According to https://3v4l.org/7KMJB this is fixed in PHP 7. As
PHP 5.6 is no longer actively supported I'm closing this issue.
Previous Comments:
------------------------------------------------------------------------
[2017-02-06 14:45:01] vitall at ua dot fm
Description:
------------
Array copy but don't have time to separate if at once follow function with &...$ar
Test script:
---------------
$ar[0]=1; $ar[1]=2; $ar[2]=3;
$ar2=$ar;
print_r($ar2);
some_func('arg',...$ar);
print_r($ar2); // same as in $ar
function some_func($a, &...$arr){
$arr[0]='one';
$arr[1]='two';
$arr[2]='three';
}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74052&edit=1