3v4l.org

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