3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $wertA = array(1, 2, 3, 4, 5, 6); $wertA2 = array_slice ($wertA, 0, 3, true); $wertA3 = array_slice ($wertA, 3, null, true); var_dump($wertA2); var_dump($wertA3);
Output for 5.2.4 - 7.1.0
array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) } array(3) { [3]=> int(4) [4]=> int(5) [5]=> int(6) }
Output for 5.0.2 - 5.2.3
array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) } array(0) { }
Output for 4.3.0 - 5.0.1
Warning: Wrong parameter count for array_slice() in /in/NEkBK on line 3 Warning: Wrong parameter count for array_slice() in /in/NEkBK on line 4 NULL NULL