3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function a($a, $b = null) { var_dump($a); var_dump(isset($a)); var_dump(is_null($a)); var_dump($b); var_dump(isset($b)); var_dump(is_null($b)); } a(); print "---"; a(1); print "---"; a(1,2); print "---"; a(null); print "---"; a(null, null); print "---";
Output for 7.1.0 - 7.2.0
Fatal error: Uncaught ArgumentCountError: Too few arguments to function a(), 0 passed in /in/tIb9i on line 12 and at least 1 expected in /in/tIb9i:3 Stack trace: #0 /in/tIb9i(12): a() #1 {main} thrown in /in/tIb9i on line 3
Process exited with code 255.
Output for 5.3.19 - 7.0.20
Warning: Missing argument 1 for a(), called in /in/tIb9i on line 12 and defined in /in/tIb9i on line 3 Notice: Undefined variable: a in /in/tIb9i on line 4 NULL bool(false) Notice: Undefined variable: a in /in/tIb9i on line 6 bool(true) NULL bool(false) bool(true) ---int(1) bool(true) bool(false) NULL bool(false) bool(true) ---int(1) bool(true) bool(false) int(2) bool(true) bool(false) ---NULL bool(false) bool(true) NULL bool(false) bool(true) ---NULL bool(false) bool(true) NULL bool(false) bool(true) ---