3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array = [1, 6, 2]; array_unshift($array, array_pop($array)); print_r($array); $array = [1, 6, 2]; $tmp = array_splice($array, 2, 1) array_unshift($array, $tmp[0]); print_r($array);
Output for 5.4.0 - 5.4.31
Parse error: syntax error, unexpected 'array_unshift' (T_STRING) in /in/q5ogu on line 9
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/q5ogu on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/q5ogu on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/q5ogu on line 3
Process exited with code 255.