3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php declare(strict_types=1); /* Akzeptiert NULL Werte */ function test(int $obj) { } test(null); test(2);
based on Dr4tZ
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught TypeError: Argument 1 passed to test() must be of the type integer, null given, called in /in/v483h on line 9 and defined in /in/v483h:5 Stack trace: #0 /in/v483h(9): test(NULL) #1 {main} thrown in /in/v483h on line 5
Process exited with code 255.
Output for 5.3.22 - 5.6.28
Warning: Unsupported declare 'strict_types' in /in/v483h on line 2 Catchable fatal error: Argument 1 passed to test() must be an instance of int, null given, called in /in/v483h on line 9 and defined in /in/v483h on line 5
Process exited with code 255.