3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $arrays = array( array( 'resize', 'width' => 2, 'height' => 3), array( 'resize', 'height' => 3, 'width' => 2), array( 'width' => 2, 'height' => 3, 'resize'), array( 'resize', '_width' => 2, 'height' => 3), ); foreach($arrays as $array){ ksort($array); var_dump($array); } echo "\n\n"; var_dump($arrays);
Output for 7.0.0 - 7.2.0
array(3) { [0]=> string(6) "resize" ["height"]=> int(3) ["width"]=> int(2) } array(3) { [0]=> string(6) "resize" ["height"]=> int(3) ["width"]=> int(2) } array(3) { [0]=> string(6) "resize" ["height"]=> int(3) ["width"]=> int(2) } array(3) { [0]=> string(6) "resize" ["_width"]=> int(2) ["height"]=> int(3) } array(4) { [0]=> array(3) { [0]=> string(6) "resize" ["width"]=> int(2) ["height"]=> int(3) } [1]=> array(3) { [0]=> string(6) "resize" ["height"]=> int(3) ["width"]=> int(2) } [2]=> array(3) { ["width"]=> int(2) ["height"]=> int(3) [0]=> string(6) "resize" } [3]=> array(3) { [0]=> string(6) "resize" ["_width"]=> int(2) ["height"]=> int(3) } }
Output for 4.3.0 - 5.6.25
array(3) { ["height"]=> int(3) ["width"]=> int(2) [0]=> string(6) "resize" } array(3) { [0]=> string(6) "resize" ["height"]=> int(3) ["width"]=> int(2) } array(3) { [0]=> string(6) "resize" ["height"]=> int(3) ["width"]=> int(2) } array(3) { [0]=> string(6) "resize" ["_width"]=> int(2) ["height"]=> int(3) } array(4) { [0]=> array(3) { [0]=> string(6) "resize" ["width"]=> int(2) ["height"]=> int(3) } [1]=> array(3) { [0]=> string(6) "resize" ["height"]=> int(3) ["width"]=> int(2) } [2]=> array(3) { ["width"]=> int(2) ["height"]=> int(3) [0]=> string(6) "resize" } [3]=> array(3) { [0]=> string(6) "resize" ["_width"]=> int(2) ["height"]=> int(3) } }