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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 10:01:30 2024 UTC