3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function foo1($a=null, $b) { var_dump($a); var_dump($b); } foo1(1, 2); foo1(3);
Output for 7.1.0
int(1) int(2) Fatal error: Uncaught ArgumentCountError: Too few arguments to function foo1(), 1 passed in /in/UHq5D on line 9 and exactly 2 expected in /in/UHq5D:3 Stack trace: #0 /in/UHq5D(9): foo1(3) #1 {main} thrown in /in/UHq5D on line 3
Process exited with code 255.
Output for 5.1.0 - 5.6.28, 7.0.0 - 7.0.14
int(1) int(2) Warning: Missing argument 2 for foo1(), called in /in/UHq5D on line 9 and defined in /in/UHq5D on line 3 int(3) Notice: Undefined variable: b in /in/UHq5D on line 5 NULL
Output for hhvm-3.12.0
int(1) int(2) Warning: foo1() expects exactly 2 parameters, 1 given in /in/UHq5D on line 4 int(3) Notice: Undefined variable: b in /in/UHq5D on line 5 NULL
Output for hhvm-3.10.0

Process exited with code 153.
Output for 4.3.0 - 5.0.5
int(1) int(2) Warning: Missing argument 2 for foo1() in /in/UHq5D on line 3 int(3) NULL