3v4l.org

run code in 300+ PHP versions simultaneously
<?php function rec($dir, $depth) { $d = dir($dir); if (!$d) return; while ($entry = $d->read()) { if ($entry == '.' || $entry == '..') continue; echo $depth . $entry . "\n"; if (is_dir($dir . '/' . $entry)) { rec($dir . '/' . $entry, $depth . " "); } } } rec('/usr', '');
Output for 8.0.14 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Warning: dir(): open_basedir restriction in effect. File(/usr) is not within the allowed path(s): (/tmp:/in:/etc) in /in/VHIM0 on line 3 Warning: dir(/usr): Failed to open directory: Operation not permitted in /in/VHIM0 on line 3
Output for 8.0.0 - 8.0.13
share iana-etc port-numbers.iana protocol-numbers.iana licenses iana-etc LICENSE factory etc crypttab fstab group gshadow host.conf hosts issue ld.so.conf motd nsswitch.conf passwd profile resolv.conf securetty shadow shells man man1 man2 man3 man4 man5 man6 man7 man8 misc pixmaps archlinux-logo.png archlinux-logo.svg archlinux.png archlinux.svg bin Warning: dir(/usr/bin): Failed to open directory: Permission denied in /in/VHIM0 on line 3 include lib Warning: dir(/usr/lib): Failed to open directory: Permission denied in /in/VHIM0 on line 3 lib64 Warning: dir(/usr/lib64): Failed to open directory: Permission denied in /in/VHIM0 on line 3 local bin etc games include lib man sbin share man src sbin Warning: dir(/usr/sbin): Failed to open directory: Permission denied in /in/VHIM0 on line 3 src
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.34, 7.3.0 - 7.3.33, 7.4.0 - 7.4.25, 7.4.33
share iana-etc port-numbers.iana protocol-numbers.iana licenses iana-etc LICENSE factory etc crypttab fstab group gshadow host.conf hosts issue ld.so.conf motd nsswitch.conf passwd profile resolv.conf securetty shadow shells man man1 man2 man3 man4 man5 man6 man7 man8 misc pixmaps archlinux-logo.png archlinux-logo.svg archlinux.png archlinux.svg bin Warning: dir(/usr/bin): failed to open dir: Permission denied in /in/VHIM0 on line 3 include lib Warning: dir(/usr/lib): failed to open dir: Permission denied in /in/VHIM0 on line 3 lib64 Warning: dir(/usr/lib64): failed to open dir: Permission denied in /in/VHIM0 on line 3 local bin etc games include lib man sbin share man src sbin Warning: dir(/usr/sbin): failed to open dir: Permission denied in /in/VHIM0 on line 3 src
Output for 7.4.26 - 7.4.32
Warning: dir(): open_basedir restriction in effect. File(/usr) is not within the allowed path(s): (/tmp:/in:/etc) in /in/VHIM0 on line 3 Warning: dir(/usr): failed to open dir: Operation not permitted in /in/VHIM0 on line 3

preferences:
290.19 ms | 402 KiB | 385 Q