3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = ['a' => 5, 'b' => 6, 'c' => 12]; $b = array_slice($a, 'b', 1); print_r($b);
Output for 7.0.0 - 7.2.0
Warning: array_slice() expects parameter 2 to be integer, string given in /in/FnMAG on line 5
Output for 5.4.12 - 5.6.28
Warning: array_slice() expects parameter 2 to be long, string given in /in/FnMAG on line 5
Output for 5.3.22 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/FnMAG on line 3
Process exited with code 255.