3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function x(&$a) { return array('x'); } $y = 'y'; echo "1\n"; var_dump(x($y)); echo "2\n"; var_dump(call_user_func_array('x', array($y)));
Output for 7.1.0
1 array(1) { [0]=> string(1) "x" } 2 Warning: Parameter 1 to x() expected to be a reference, value given in /in/mNEdk on line 9 array(1) { [0]=> string(1) "x" }
Output for 5.3.0 - 7.0.14
1 array(1) { [0]=> string(1) "x" } 2 Warning: Parameter 1 to x() expected to be a reference, value given in /in/mNEdk on line 9 NULL
Output for 4.3.0 - 5.2.17
1 array(1) { [0]=> string(1) "x" } 2 array(1) { [0]=> string(1) "x" }