3v4l.org

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