3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function xpto1($name, $val) { xpto2($name, $val, true); } function xpto2($name, $val = "xpto", $xcenas) { echo 'name: ' . $name; echo 'val: ' . $val; echo 'xcenas: ' . $xcenas; } xpto1('abc');
based on e8b9u
Output for 7.1.0 - 7.2.0
Fatal error: Uncaught ArgumentCountError: Too few arguments to function xpto1(), 1 passed in /in/TmjNU on line 13 and exactly 2 expected in /in/TmjNU:3 Stack trace: #0 /in/TmjNU(13): xpto1('abc') #1 {main} thrown in /in/TmjNU on line 3
Process exited with code 255.
Output for 5.3.21 - 7.0.20
Warning: Missing argument 2 for xpto1(), called in /in/TmjNU on line 13 and defined in /in/TmjNU on line 3 Notice: Undefined variable: val in /in/TmjNU on line 4 name: abcval: xcenas: 1