3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = ['a' => 1, 'b' => 2, 'c' => 3]; $b = [4,5]; print_r($a); print_r($b); $r= array_splice($a, 2, 2, $b); $r1 = array_slice($a, 2,1,1); print_r($r); print_r($r1);
Output for 5.6.30, hhvm-3.15.4 - 3.22.0, 7.0.0 - 7.2.11
Array ( [a] => 1 [b] => 2 [c] => 3 ) Array ( [0] => 4 [1] => 5 ) Array ( [c] => 3 ) Array ( [0] => 4 )