3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function test( string $str ) { echo $str; } $str = null; //test( $str ); $str = ""; test( $str );
based on Wc2cP
Output for hhvm-3.15.4, 7.0.0 - 7.3.0rc3
Output for 5.6.0 - 5.6.30
Catchable fatal error: Argument 1 passed to test() must be an instance of string, string given, called in /in/vO1ej on line 12 and defined in /in/vO1ej on line 3
Process exited with code 255.