3v4l.org

run code in 300+ PHP versions simultaneously
<?php function validateResources(array $resources) { array_walk($resources, function(Resource $resource) {}); } $fp = fopen('php://input', 'r'); validateResources([$fp]);
Output for 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
Fatal error: Uncaught TypeError: {closure:validateResources():5}(): Argument #1 ($resource) must be of type Resource, resource given in /in/eTDIj:5 Stack trace: #0 [internal function]: {closure:validateResources():5}(Resource id #7, 0) #1 /in/eTDIj(5): array_walk(Array, Object(Closure)) #2 /in/eTDIj(8): validateResources(Array) #3 {main} thrown in /in/eTDIj on line 5
Process exited with code 255.
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30
Fatal error: Uncaught TypeError: {closure}(): Argument #1 ($resource) must be of type Resource, resource given in /in/eTDIj:5 Stack trace: #0 [internal function]: {closure}(Resource id #7, 0) #1 /in/eTDIj(5): array_walk(Array, Object(Closure)) #2 /in/eTDIj(8): validateResources(Array) #3 {main} thrown in /in/eTDIj on line 5
Process exited with code 255.
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33
Fatal error: Uncaught TypeError: Argument 1 passed to {closure}() must be an instance of Resource, resource given in /in/eTDIj:5 Stack trace: #0 [internal function]: {closure}(Resource id #7, 0) #1 /in/eTDIj(5): array_walk(Array, Object(Closure)) #2 /in/eTDIj(8): validateResources(Array) #3 {main} thrown in /in/eTDIj on line 5
Process exited with code 255.
Output for 5.5.0 - 5.5.35, 5.6.0 - 5.6.28
Catchable fatal error: Argument 1 passed to {closure}() must be an instance of Resource, resource given in /in/eTDIj on line 5
Process exited with code 255.

preferences:
95.73 ms | 1701 KiB | 4 Q