3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php declare(ticks=1); function tick_handler() { echo "tick_handler() called\n"; } function inverse($x) {tick_handler(); if (!$x) {tick_handler(); throw new Exception('Division by zero.');tick_handler(); } return 1/$x;tick_handler(); } inverse(); ?>
Output for 7.1.0
Fatal error: Uncaught ArgumentCountError: Too few arguments to function inverse(), 0 passed in /in/WfRuW on line 17 and exactly 1 expected in /in/WfRuW:8 Stack trace: #0 /in/WfRuW(17): inverse() #1 {main} thrown in /in/WfRuW on line 8
Process exited with code 255.
Output for 7.0.0 - 7.0.14
Warning: Missing argument 1 for inverse(), called in /in/WfRuW on line 17 and defined in /in/WfRuW on line 8 tick_handler() called Notice: Undefined variable: x in /in/WfRuW on line 10 tick_handler() called Fatal error: Uncaught Exception: Division by zero. in /in/WfRuW:11 Stack trace: #0 /in/WfRuW(17): inverse() #1 {main} thrown in /in/WfRuW on line 11
Process exited with code 255.
Output for 5.1.0 - 5.6.28
Warning: Missing argument 1 for inverse(), called in /in/WfRuW on line 17 and defined in /in/WfRuW on line 8 tick_handler() called Notice: Undefined variable: x in /in/WfRuW on line 10 tick_handler() called Fatal error: Uncaught exception 'Exception' with message 'Division by zero.' in /in/WfRuW:11 Stack trace: #0 /in/WfRuW(17): inverse() #1 {main} thrown in /in/WfRuW on line 11
Process exited with code 255.
Output for 5.0.0 - 5.0.2, 5.0.5
Warning: Missing argument 1 for inverse() in /in/WfRuW on line 8 tick_handler() called tick_handler() called Fatal error: Uncaught exception 'Exception' with message 'Division by zero.' in /in/WfRuW:11 Stack trace: #0 /in/WfRuW(17): inverse() #1 {main} thrown in /in/WfRuW on line 11
Process exited with code 255.
Output for 5.0.3 - 5.0.4
Warning: Missing argument 1 for inverse() in /in/WfRuW on line 8 tick_handler() called tick_handler() called Fatal error: Uncaught exception 'Exception' with message 'Division by zero.' in /in/WfRuW:11 Stack trace: #0 /in/WfRuW(11): inverse() #1 /in/WfRuW(17): inverse() #2 {main} thrown in /in/WfRuW on line 11
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_NEW in /in/WfRuW on line 11
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_NEW in /in/WfRuW on line 11
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/WfRuW on line 11
Process exited with code 255.