3v4l.org

run code in 500+ PHP versions simultaneously
<?php function foo(): resource { return fopen('/tmp', 'r'); } foo();
Output for 8.2.31 - 8.2.33, 8.3.0 - 8.3.33, 8.4.1 - 8.4.25, 8.5.0 - 8.5.10
Warning: "resource" is not a supported builtin type and will be interpreted as a class name. Write "\resource" to suppress this warning in /in/h3QkW on line 3 Fatal error: Uncaught TypeError: foo(): Return value must be of type resource, resource returned in /in/h3QkW:5 Stack trace: #0 /in/h3QkW(8): foo() #1 {main} thrown in /in/h3QkW on line 5
Process exited with code 255.

preferences:
51.16 ms | 813 KiB | 4 Q