3v4l.org

run code in 200+ PHP versions simultaneously
<?php echo(array_shift(foo())); // prints "foo" echo(array_pop(foo())); // prints "tofu" function foo() { return array("foo","bar","foobar","barfoo","tofu"); }
based on Ov0e8
Output for 7.0.0 - 7.4.6
Notice: Only variables should be passed by reference in /in/voQIS on line 2 foo Notice: Only variables should be passed by reference in /in/voQIS on line 4 tofu
Output for 5.1.0 - 5.6.28
Strict Standards: Only variables should be passed by reference in /in/voQIS on line 2 foo Strict Standards: Only variables should be passed by reference in /in/voQIS on line 4 tofu
Output for 5.0.5
Fatal error: Only variables can be passed by reference in /in/voQIS on line 2
Process exited with code 255.
Output for 4.3.0 - 5.0.4
footofu