3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function foo(&$arg) { echo "hi\n"; var_dump($arg); } $a = 'bar'; $b =& $a; call_user_func('foo', $b); call_user_func('foo', $a);
based on kdFDk
Output for 7.1.0 - 7.2.0
Warning: Parameter 1 to foo() expected to be a reference, value given in /in/M2Sfq on line 11 hi string(3) "bar" Warning: Parameter 1 to foo() expected to be a reference, value given in /in/M2Sfq on line 13 hi string(3) "bar"
Output for 4.3.0 - 7.0.20
hi string(3) "bar" hi string(3) "bar"