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.7
Fatal error: Uncaught ArgumentCountError: Too few arguments to function foo(), 0 passed in /in/p7K3m on line 10 and exactly 1 expected in /in/p7K3m:3 Stack trace: #0 /in/p7K3m(10): foo() #1 {main} thrown in /in/p7K3m on line 3
Process exited with code 255.
Output for 5.6.30
Warning: Missing argument 1 for foo(), called in /in/p7K3m on line 10 and defined in /in/p7K3m on line 3 Notice: Undefined variable: firstname in /in/p7K3m on line 4 Fatal error: Uncaught exception 'Exception' with message 'Division par zéro.' in /in/p7K3m:5 Stack trace: #0 /in/p7K3m(10): foo() #1 {main} thrown in /in/p7K3m on line 5
Process exited with code 255.