3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $number_to_get = 2; $names = array("Maria", "Jan", "Elton", "Wiktor"); shuffle($names); $picks = array_slice(0, $number_to_get); var_dump($picks);
Output for 5.2.6 - 7.1.0
Warning: array_slice() expects parameter 1 to be array, integer given in /in/X14Ih on line 6 NULL
Output for 4.3.2 - 5.2.5
Warning: array_slice(): The first argument should be an array in /in/X14Ih on line 6 NULL
Output for 4.3.0 - 4.3.1
Warning: array_slice() [http://www.php.net/function.array-slice]: The first argument should be an array in /in/X14Ih on line 6 NULL