3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Example { public function foo(int $f = null) { } } $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 or null, string given, called in /in/vUPpT on line 13 and defined in /in/vUPpT:4 Stack trace: #0 /in/vUPpT(13): Example->foo('string') #1 {main} thrown in /in/vUPpT on line 4
Process exited with code 255.