3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array(0 => 'a', 'str' => 'b'); $b = array('str' => 'b', 0 => 'a'); ksort($a); ksort($b); $c = array(0, 'str'); $d = array('str', 0); sort($c); sort($d); var_export($a); echo "\n"; var_export($b); echo "\n"; var_export($c); echo "\n"; var_export($d);
Output for hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array ( 0 => 'a', 'str' => 'b', ) array ( 'str' => 'b', 0 => 'a', ) array ( 0 => 0, 1 => 'str', ) array ( 0 => 'str', 1 => 0, )
Output for 4.3.0 - 5.6.28
array ( 'str' => 'b', 0 => 'a', ) array ( 0 => 'a', 'str' => 'b', ) array ( 0 => 'str', 1 => 0, ) array ( 0 => 0, 1 => 'str', )