3v4l.org

run code in 300+ PHP versions simultaneously
<?php function read(resource $res): void {} read(fopen('php://temp', 'rw'));
Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.31, 8.2.0 - 8.2.26, 8.3.0 - 8.3.15, 8.4.1 - 8.4.2
Warning: "resource" is not a supported builtin type and will be interpreted as a class name. Write "\resource" to suppress this warning in /in/S7GRg on line 3 Fatal error: Uncaught TypeError: read(): Argument #1 ($res) must be of type resource, resource given, called in /in/S7GRg on line 5 and defined in /in/S7GRg:3 Stack trace: #0 /in/S7GRg(5): read(Resource id #5) #1 {main} thrown in /in/S7GRg on line 3
Process exited with code 255.
Output for 7.4.0 - 7.4.33
Fatal error: Uncaught TypeError: Argument 1 passed to read() must be an instance of resource, resource given, called in /in/S7GRg on line 5 and defined in /in/S7GRg:3 Stack trace: #0 /in/S7GRg(5): read(Resource id #5) #1 {main} thrown in /in/S7GRg on line 3
Process exited with code 255.

preferences:
89.31 ms | 407 KiB | 5 Q