3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function test(&$foo) { $foo = $foo + 1; echo "foo = $foo\n"; } $bar = 123; test($bar); test(); echo "bar = $bar\n";
Output for 7.1.0
foo = 124 Fatal error: Uncaught ArgumentCountError: Too few arguments to function test(), 0 passed in /in/GZaNI on line 11 and exactly 1 expected in /in/GZaNI:3 Stack trace: #0 /in/GZaNI(11): test() #1 {main} thrown in /in/GZaNI on line 3
Process exited with code 255.
Output for 5.1.0 - 5.6.28, 7.0.0 - 7.0.14
foo = 124 Warning: Missing argument 1 for test(), called in /in/GZaNI on line 11 and defined in /in/GZaNI on line 3 Notice: Undefined variable: foo in /in/GZaNI on line 5 foo = 1 bar = 124
Output for hhvm-3.10.0 - 3.12.0
foo = 124 Warning: test() expects exactly 1 parameter, 0 given in /in/GZaNI on line 5 Notice: Undefined variable: foo in /in/GZaNI on line 5 foo = 1 bar = 124
Output for 4.3.0 - 5.0.5
foo = 124 Warning: Missing argument 1 for test() in /in/GZaNI on line 3 foo = 1 bar = 124