3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php declare(strict_types = 1); function test(int $test) { var_dump($test); } $var = null; test($var);
based on Qib5m
Output for 7.3.0 - 7.3.1
Fatal error: Uncaught TypeError: Argument 1 passed to test() must be of the type int, null given, called in /in/h6veQ on line 9 and defined in /in/h6veQ:3 Stack trace: #0 /in/h6veQ(9): test(NULL) #1 {main} thrown in /in/h6veQ on line 3
Process exited with code 255.
Output for 7.0.0 - 7.2.13
Fatal error: Uncaught TypeError: Argument 1 passed to test() must be of the type integer, null given, called in /in/h6veQ on line 9 and defined in /in/h6veQ:3 Stack trace: #0 /in/h6veQ(9): test(NULL) #1 {main} thrown in /in/h6veQ on line 3
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught TypeError: Argument 1 passed to test() must be an instance of int, null given in /in/h6veQ:6 Stack trace: #0 /in/h6veQ(9): test() #1 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Warning: Unsupported declare 'strict_types' in /in/h6veQ on line 1 Catchable fatal error: Argument 1 passed to test() must be an instance of int, null given, called in /in/h6veQ on line 9 and defined in /in/h6veQ on line 3
Process exited with code 255.