3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $input = array("a"=>1, "b"=>2, "c"=>3, "d"=>4, "e"=>5); print_r(array_slice($input, -1, 1, true));
Output for 5.0.2 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Array ( [e] => 5 )
Output for 4.3.0 - 5.0.1
Warning: Wrong parameter count for array_slice() in /in/6pEEK on line 4