3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function foo (string $value) { var_dump($value); } foo(""); foo(null); foo(false);
Output for 7.0.0 - 7.2.0
string(0) "" Fatal error: Uncaught TypeError: Argument 1 passed to foo() must be of the type string, null given, called in /in/cq8A0 on line 8 and defined in /in/cq8A0:3 Stack trace: #0 /in/cq8A0(8): foo(NULL) #1 {main} thrown in /in/cq8A0 on line 3
Process exited with code 255.
Output for 5.3.17 - 5.6.21
Catchable fatal error: Argument 1 passed to foo() must be an instance of string, string given, called in /in/cq8A0 on line 7 and defined in /in/cq8A0 on line 3
Process exited with code 255.