3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = array('orange', 'blue', 'gray'); $s = array_shift($a); var_dump($s); print_r($a); $a = array(); $s = array_shift($a); var_dump($s); print_r($a);
based on PEYAr
Output for 4.3.0 - 7.2.0
string(6) "orange" Array ( [0] => blue [1] => gray ) NULL Array ( )