|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-10-05 09:52 UTC] inefedor at gmail dot com
[2015-10-05 16:07 UTC] stas@php.net
-Package: PHP Language Specification
+Package: Scripting Engine problem
[2015-10-05 16:08 UTC] stas@php.net
-Status: Open
+Status: Not a bug
[2015-10-05 16:08 UTC] stas@php.net
[2015-10-09 10:43 UTC] alex-dev at yandex dot ru
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 07 06:00:01 2026 UTC |
Description: ------------ Array $test soured after use link in foreach. Test script: --------------- $test = array(1 => 1, 2 => 2, 3 => 3); foreach($test as $key => &$value) { } uasort($test, function($a, $b) { if($a > $b) return -1; else if($a > $b) return 1; else return 0; }); print_r($test); foreach($test as $key => $value) { } print_r($test); Expected result: ---------------- Array ( [3] => 3 [2] => 2 [1] => 1 ) Array ( [3] => 1 [2] => 2 [1] => 1 )