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 "\n\n---\n\n"; a(1); print "\n\n---\n\n"; a(1,2); print "\n\n---\n\n"; a(null); print "\n\n---\n\n"; a(null, null); print "\n\n---\n\n";
based on tIb9i
Output for 7.1.0 - 7.2.0
Fatal error: Uncaught ArgumentCountError: Too few arguments to function a(), 0 passed in /in/nfNfC on line 12 and at least 1 expected in /in/nfNfC:3 Stack trace: #0 /in/nfNfC(12): a() #1 {main} thrown in /in/nfNfC 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/nfNfC on line 12 and defined in /in/nfNfC on line 3 Notice: Undefined variable: a in /in/nfNfC on line 4 NULL bool(false) Notice: Undefined variable: a in /in/nfNfC 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) ---