3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function test(string $t) { echo $t.PHP_EOL; } test('Hello!'); test((string) null);
based on EjaSW
Output for 7.0.0 - 7.3.0beta1
Hello!
Output for 5.6.0 - 5.6.28
Catchable fatal error: Argument 1 passed to test() must be an instance of string, string given, called in /in/lpjcu on line 7 and defined in /in/lpjcu on line 3
Process exited with code 255.