3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo(&$obj) { return $obj; } $o = new StdClass; // No errors foo($o); call_user_func('foo', $o); call_user_func('foo', [$o]); $a[] = $o; $a[] = $o; $a[] = $o; // Warning: Parameter 1 to foo() expected to be a reference, value given in call_user_func('foo', array_slice($a, 0, 1));

preferences:
24.03 ms | 404 KiB | 5 Q