3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array('one' => 1, 'two' => 2); var_dump(array_slice($a, 0, 1, true)); var_dump(array_slice($a, 0, 1, false));
Output for 5.0.2 - 7.1.0
array(1) { ["one"]=> int(1) } array(1) { ["one"]=> int(1) }
Output for 4.3.0 - 5.0.1
Warning: Wrong parameter count for array_slice() in /in/qJlu2 on line 4 NULL Warning: Wrong parameter count for array_slice() in /in/qJlu2 on line 5 NULL