3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function &return_a() { global $a; return $a; } $a = array(1,2,3); array_shift(return_a()); print_r($a); $a = array(1,2,3); array_shift((return_a())); print_r($a);
Output for 4.3.0 - 5.1.1, 5.6.0 - 7.1.0
Array ( [0] => 2 [1] => 3 ) Array ( [0] => 2 [1] => 3 )
Output for 5.2.1 - 5.5.36
Array ( [0] => 2 [1] => 3 ) Strict Standards: Only variables should be passed by reference in /in/Cju1c on line 13 Array ( [0] => 1 [1] => 2 [2] => 3 )
Output for 5.1.2 - 5.2.0
Strict Standards: Only variables should be passed by reference in /in/Cju1c on line 9 Array ( [0] => 1 [1] => 2 [2] => 3 ) Strict Standards: Only variables should be passed by reference in /in/Cju1c on line 13 Array ( [0] => 1 [1] => 2 [2] => 3 )