3v4l.org

run code in 200+ php & hhvm versions
<?php function foo(&$obj) { return $obj; } $o = array(); // No errors foo($o); call_user_func('foo', $o); call_user_func('foo', [$o]); $a[] = array(); $a[] = array(); $a[] = array(); // Warning: Parameter 1 to foo() expected to be a reference, value given in call_user_func('foo', array_slice($a, 0, 1));
based on oBnkT
Output for 7.1.0 - 7.2.6
Warning: Parameter 1 to foo() expected to be a reference, value given in /in/TZaVe on line 10 Warning: Parameter 1 to foo() expected to be a reference, value given in /in/TZaVe on line 11 Warning: Parameter 1 to foo() expected to be a reference, value given in /in/TZaVe on line 18
Output for 7.0.0 - 7.0.8, 7.0.10 - 7.0.20
Warning: Parameter 1 to foo() expected to be a reference, value given in /in/TZaVe on line 18
Output for 7.0.9
Warning: Parameter 1 to foo() expected to be a reference, value given in /in/TZaVe on line 10 Warning: Parameter 1 to foo() expected to be a reference, value given in /in/TZaVe on line 18
Output for 5.6.0 - 5.6.26
Warning: Parameter 1 to foo() expected to be a reference, value given in /in/TZaVe on line 10