php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74052 Don't unbinding same arrays when copy $ar2=$ar; &...$ar; $ar2 related with $ar
Submitted: 2017-02-06 14:45 UTC Modified: 2017-02-06 14:51 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: vitall at ua dot fm Assigned: nikic (profile)
Status: Closed Package: Arrays related
PHP Version: 5.6.30 OS: Windows 7
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: vitall at ua dot fm
New email:
PHP Version: OS:

 

 [2017-02-06 14:45 UTC] 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';
}


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-02-06 14:51 UTC] nikic@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: nikic
 [2017-02-06 14:51 UTC] nikic@php.net
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.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Tue Oct 06 15:00:01 2026 UTC