3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function do_html_heading($level = 1, $heading) { echo "<h" . ($level = (int)$level ? : 1) . ">" . $heading . "</h{$level}>" ; } do_html_heading("mon titre");
Output for 7.1.0
Fatal error: Uncaught ArgumentCountError: Too few arguments to function do_html_heading(), 1 passed in /in/8qU7Z on line 6 and exactly 2 expected in /in/8qU7Z:2 Stack trace: #0 /in/8qU7Z(6): do_html_heading('mon titre') #1 {main} thrown in /in/8qU7Z on line 2
Process exited with code 255.
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.0.14
Warning: Missing argument 2 for do_html_heading(), called in /in/8qU7Z on line 6 and defined in /in/8qU7Z on line 2 Notice: Undefined variable: heading in /in/8qU7Z on line 3 <h1></h1>
Output for hhvm-3.12.0
Warning: do_html_heading() expects exactly 2 parameters, 1 given in /in/8qU7Z on line -1 Notice: Undefined variable: heading in /in/8qU7Z on line -1 <h1></h1>
Output for hhvm-3.10.0
Warning: do_html_heading() expects exactly 2 parameters, 1 given in /in/8qU7Z on line 3 Notice: Undefined variable: heading in /in/8qU7Z on line 3 <h1></h1>
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected ':' in /in/8qU7Z on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected ':' in /in/8qU7Z on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/8qU7Z on line 3
Process exited with code 255.