3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Resource { } function test(int $resource) { } $r = new Resource(); test($r);
based on KOLDK
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught TypeError: Argument 1 passed to test() must be of the type integer, object given, called in /in/SAlc0 on line 14 and defined in /in/SAlc0:8 Stack trace: #0 /in/SAlc0(14): test(Object(Resource)) #1 {main} thrown in /in/SAlc0 on line 8
Process exited with code 255.
Output for 5.3.20 - 5.6.28
Catchable fatal error: Argument 1 passed to test() must be an instance of int, instance of Resource given, called in /in/SAlc0 on line 14 and defined in /in/SAlc0 on line 8
Process exited with code 255.