3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function &g(&$v) { return 5; } function f(&$v) { $v = 5; } $foo = null; $name = 'foo'; call_user_func_array('f', array(g($$name))); //var_dump(array(g($$name))); var_dump($foo);
Output for 7.0.0 - 7.1.0
Notice: Only variable references should be returned by reference in /in/hhAtO on line 3 Warning: Parameter 1 to f() expected to be a reference, value given in /in/hhAtO on line 12 NULL
Output for hhvm-3.10.0 - 3.12.0
Warning: Parameter 1 to f() expected to be a reference, value given in /in/hhAtO on line 12 NULL
Output for 4.4.0 - 4.4.9, 5.1.0 - 5.6.28
Notice: Only variable references should be returned by reference in /in/hhAtO on line 3 NULL
Output for 5.0.0 - 5.0.5
Strict Standards: Only variable references should be returned by reference in /in/hhAtO on line 3 NULL
Output for 4.3.0 - 4.3.11
NULL