3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array_fill(0, 20, true); var_dump(array_slice($a, 15, null, true)); var_dump(array_slice(array_reverse($a, true), 15, null, true));
Output for 5.2.4 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(5) { [15]=> bool(true) [16]=> bool(true) [17]=> bool(true) [18]=> bool(true) [19]=> bool(true) } array(5) { [4]=> bool(true) [3]=> bool(true) [2]=> bool(true) [1]=> bool(true) [0]=> bool(true) }
Output for 5.0.2 - 5.2.3
array(0) { } array(0) { }
Output for 4.3.0 - 5.0.1
Warning: Wrong parameter count for array_slice() in /in/7lOc9 on line 4 NULL Warning: Wrong parameter count for array_slice() in /in/7lOc9 on line 5 NULL