3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $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);
Output for 7.0.0 - 7.2.0
Array ( [1] => 1 [2] => 2 [3] => 3 ) Array ( [1] => 1 [2] => 2 [3] => 2 )
Output for 5.3.18 - 5.6.28
Array ( [3] => 3 [2] => 2 [1] => 1 ) Array ( [3] => 1 [2] => 2 [1] => 1 )