3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo(&$a, &$b, $c) { var_dump($ab, $b, $c); } $x = 1; $y = 2; $z = 3; call_user_func_array("foo", array($x, $y, $z));
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Warning: foo(): Argument #1 ($a) must be passed by reference, value given in /in/p5QUT on line 9 Warning: foo(): Argument #2 ($b) must be passed by reference, value given in /in/p5QUT on line 9 Warning: Undefined variable $ab in /in/p5QUT on line 4 NULL int(2) int(3)
Output for 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.31, 7.4.0 - 7.4.33
Warning: Parameter 1 to foo() expected to be a reference, value given in /in/p5QUT on line 9 Warning: Parameter 2 to foo() expected to be a reference, value given in /in/p5QUT on line 9 Notice: Undefined variable: ab in /in/p5QUT on line 4 NULL int(2) int(3)
Output for 7.3.32 - 7.3.33
Warning: Parameter 1 to foo() expected to be a reference, value given in /in/p5QUT on line 9 Warning: Parameter 2 to foo() expected to be a reference, value given in /in/p5QUT on line 9 NULL int(2) int(3)
Output for 5.5.24 - 5.5.35, 5.6.8 - 5.6.28, 7.0.0 - 7.0.20
Warning: Parameter 1 to foo() expected to be a reference, value given in /in/p5QUT on line 9

preferences:
171.09 ms | 402 KiB | 179 Q