run code in 200+ php & hhvm versions
Bugs & Features
<?php declare(strict_types=0); 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/RqOOd on line 13 and defined in /in/RqOOd:6 Stack trace: #0 /in/RqOOd(13): Example->foo(NULL) #1 {main} thrown in /in/RqOOd on line 6
Process exited with code 255.