3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php declare(strict_types=1); function x(string $x) { } x(null);
based on TKjvD
Output for 7.0.0 - 7.3.0rc3
Fatal error: Uncaught TypeError: Argument 1 passed to x() must be of the type string, null given, called in /in/VNYDL on line 8 and defined in /in/VNYDL:4 Stack trace: #0 /in/VNYDL(8): x(NULL) #1 {main} thrown in /in/VNYDL on line 4
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught TypeError: Argument 1 passed to x() must be an instance of string, null given in /in/VNYDL:6 Stack trace: #0 /in/VNYDL(8): x() #1 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Warning: Unsupported declare 'strict_types' in /in/VNYDL on line 2 Catchable fatal error: Argument 1 passed to x() must be an instance of string, null given, called in /in/VNYDL on line 8 and defined in /in/VNYDL on line 4
Process exited with code 255.