3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function foo ($firstname) { if (!$firstname) { throw new \Exception('Division par zéro.'); } } foo();
Output for 7.1.0 - 7.3.0rc3
Fatal error: Uncaught ArgumentCountError: Too few arguments to function foo(), 0 passed in /in/n9asC on line 10 and exactly 1 expected in /in/n9asC:3 Stack trace: #0 /in/n9asC(10): foo() #1 {main} thrown in /in/n9asC on line 3
Process exited with code 255.
Output for 7.0.0 - 7.0.20
Warning: Missing argument 1 for foo(), called in /in/n9asC on line 10 and defined in /in/n9asC on line 3 Notice: Undefined variable: firstname in /in/n9asC on line 4 Fatal error: Uncaught Exception: Division par zéro. in /in/n9asC:5 Stack trace: #0 /in/n9asC(10): foo() #1 {main} thrown in /in/n9asC on line 5
Process exited with code 255.
Output for hhvm-3.15.4
Warning: foo() expects exactly 1 parameter, 0 given in /in/n9asC on line 4 Notice: Undefined variable: firstname in /in/n9asC on line 4 Fatal error: Uncaught exception 'Exception' with message 'Division par zéro.' in /in/n9asC:5 Stack trace: #0 /in/n9asC(10): foo() #1 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Warning: Missing argument 1 for foo(), called in /in/n9asC on line 10 and defined in /in/n9asC on line 3 Notice: Undefined variable: firstname in /in/n9asC on line 4 Fatal error: Uncaught exception 'Exception' with message 'Division par zéro.' in /in/n9asC:5 Stack trace: #0 /in/n9asC(10): foo() #1 {main} thrown in /in/n9asC on line 5
Process exited with code 255.