mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
d65c395049
The array isn't just observable if the array has RCn, but also if it is inside a reference that is RCn. By-ref parameters are always RCn and as such always observable. Fixes GH-13279 Closes GH-13285
19 lines
299 B
PHP
19 lines
299 B
PHP
--TEST--
|
|
GH-13279: Instable array during in-place modification in uksort
|
|
--FILE--
|
|
<?php
|
|
|
|
// Make sure the array is not const
|
|
$array = [];
|
|
$array['a'] = 1;
|
|
$array['b'] = 2;
|
|
|
|
uksort($array, function ($a, $b) use (&$array) {
|
|
return $array[$a] - $array[$b];
|
|
});
|
|
|
|
?>
|
|
===DONE===
|
|
--EXPECT--
|
|
===DONE===
|