3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $foo = array( 'a' => -1, 'b' => 0, 'c' => 0, ); asort($foo, SORT_NUMERIC); var_dump($foo); $foo = array( 'a' => -1, 'b' => 0, 'c' => 0, 'd' => 0, ); asort($foo, SORT_NUMERIC); var_dump($foo);
Output for hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(3) { ["a"]=> int(-1) ["b"]=> int(0) ["c"]=> int(0) } array(4) { ["a"]=> int(-1) ["b"]=> int(0) ["c"]=> int(0) ["d"]=> int(0) }
Output for 4.3.0 - 5.6.28
array(3) { ["a"]=> int(-1) ["c"]=> int(0) ["b"]=> int(0) } array(4) { ["a"]=> int(-1) ["d"]=> int(0) ["b"]=> int(0) ["c"]=> int(0) }