run code in 200+ php & hhvm versions
Bugs & Features
<?php class Example { public function foo(int $f) { } } $e = new Example; $e->foo(null); //$e->foo(9); //$e->foo('string');
Output for 7.1.7
Fatal error: Uncaught TypeError: Argument 1 passed to Example::foo() must be of the type integer, null given, called in /in/aVm5D on line 12 and defined in /in/aVm5D:5 Stack trace: #0 /in/aVm5D(12): Example->foo(NULL) #1 {main} thrown in /in/aVm5D on line 5
Process exited with code 255.