3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo function_exists('getdir') ? 'yes' : 'no', PHP_EOL; var_dump(getdir('/tmp'));
Output for 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.5 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
no Fatal error: Uncaught Error: Call to undefined function getdir() in /in/ZHJ9U:5 Stack trace: #0 {main} thrown in /in/ZHJ9U on line 5
Process exited with code 255.
Output for 8.0.0 - 8.0.3
yes object(Directory)#1 (2) { ["path"]=> string(4) "/tmp" ["handle"]=> resource(5) of type (stream) }

preferences:
130.9 ms | 401 KiB | 150 Q