3v4l.org

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