3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array(100=>'a',200=>'b',300=>'c',400=>'d'); array_unshift($a,'z'); print_R($a); // What you have to do $a = array(100=>'a',200=>'b',300=>'c',400=>'d'); $a = array('z') + $a; print_R($a);
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Array ( [0] => z [1] => a [2] => b [3] => c [4] => d ) Array ( [0] => z [100] => a [200] => b [300] => c [400] => d )