|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-05-30 20:44 UTC] requinix@php.net
-Status: Open
+Status: Not a bug
[2016-05-30 20:44 UTC] requinix@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 08 22:00:01 2025 UTC |
Description: ------------ PHP version 5.6.22 from PHP 5.6.22-2+donate.sury.org~trusty+1 When array is firstly iterated by reference for $value, and then iterated without reference, last $value in second foreach is incorrect. Test script: --------------- $arr = [1, 2]; foreach ($arr as &$value) {} foreach ($arr as $value) { echo "$value\n"; } Expected result: ---------------- 1 2 Actual result: -------------- 1 1