3v4l.org

run code in 300+ PHP versions simultaneously
<?php //$f = new SplFileObject('/usr/hi.txt', "w+"); $iterator = new RecursiveDirectoryIterator('/etc'); while($iterator->valid()) { $file = $iterator->current(); echo $iterator->key() . " => " . $file->getFilename() . "\n"; $iterator->next(); }
Output for 8.1.24 - 8.1.28, 8.2.11 - 8.2.18, 8.3.0 - 8.3.6
/etc/. => . /etc/.. => .. /etc/mtab => mtab /etc/ld.so.conf.d => ld.so.conf.d /etc/pacman.d => pacman.d /etc/profile.d => profile.d /etc/skel => skel /etc/arch-release => arch-release /etc/crypttab => crypttab /etc/fstab => fstab /etc/group => group /etc/gshadow => gshadow /etc/host.conf => host.conf /etc/hosts => hosts /etc/issue => issue /etc/ld.so.conf => ld.so.conf /etc/motd => motd /etc/nsswitch.conf => nsswitch.conf /etc/passwd => passwd /etc/php.ini => php.ini /etc/php_archive.ini => php_archive.ini /etc/profile => profile /etc/protocols => protocols /etc/resolv.conf => resolv.conf /etc/securetty => securetty /etc/services => services /etc/shadow => shadow /etc/shells => shells
Output for 7.4.26 - 7.4.33, 8.0.14 - 8.0.30, 8.1.0 - 8.1.23, 8.2.0 - 8.2.10
/etc/. => . /etc/.. => .. /etc/pacman.d => pacman.d /etc/protocols => protocols /etc/services => services /etc/arch-release => arch-release /etc/crypttab => crypttab /etc/fstab => fstab /etc/group => group /etc/gshadow => gshadow /etc/host.conf => host.conf /etc/hosts => hosts /etc/issue => issue /etc/ld.so.conf => ld.so.conf /etc/ld.so.conf.d => ld.so.conf.d /etc/motd => motd /etc/mtab => mtab /etc/nsswitch.conf => nsswitch.conf /etc/passwd => passwd /etc/profile => profile /etc/profile.d => profile.d /etc/resolv.conf => resolv.conf /etc/securetty => securetty /etc/shadow => shadow /etc/shells => shells /etc/skel => skel /etc/php.ini => php.ini /etc/php_archive.ini => php_archive.ini
Output for 7.3.32 - 7.3.33, 8.0.13
/etc/. => . /etc/.. => .. /etc/pacman.d => pacman.d /etc/protocols => protocols /etc/services => services /etc/arch-release => arch-release /etc/crypttab => crypttab /etc/fstab => fstab /etc/group => group /etc/gshadow => gshadow /etc/host.conf => host.conf /etc/hosts => hosts /etc/issue => issue /etc/ld.so.conf => ld.so.conf /etc/ld.so.conf.d => ld.so.conf.d /etc/motd => motd /etc/mtab => mtab /etc/nsswitch.conf => nsswitch.conf /etc/passwd => passwd /etc/profile => profile /etc/profile.d => profile.d /etc/resolv.conf => resolv.conf /etc/securetty => securetty /etc/shadow => shadow /etc/shells => shells /etc/skel => skel
Output for 7.3.31, 7.4.24 - 7.4.25, 8.0.11 - 8.0.12
/etc/. => . /etc/.. => .. /etc/pacman.d => pacman.d /etc/ld.so.conf.d => ld.so.conf.d /etc/profile.d => profile.d /etc/skel => skel /etc/php_archive.ini => php_archive.ini /etc/php.ini => php.ini /etc/localtime => localtime /etc/locale.gen => locale.gen /etc/resolv.conf => resolv.conf /etc/protocols => protocols /etc/services => services /etc/arch-release => arch-release /etc/crypttab => crypttab /etc/fstab => fstab /etc/group => group /etc/gshadow => gshadow /etc/host.conf => host.conf /etc/hosts => hosts /etc/issue => issue /etc/ld.so.conf => ld.so.conf /etc/motd => motd /etc/mtab => mtab /etc/nsswitch.conf => nsswitch.conf /etc/passwd => passwd /etc/profile => profile /etc/securetty => securetty /etc/shadow => shadow /etc/shells => shells /etc/gai.conf => gai.conf /etc/locale.gen.pacnew => locale.gen.pacnew /etc/nscd.conf => nscd.conf /etc/rpc => rpc /etc/xattr.conf => xattr.conf /etc/ld.so.cache => ld.so.cache
Output for 7.2.29 - 7.2.33, 7.3.16 - 7.3.17, 7.3.19 - 7.3.30, 7.4.3, 7.4.7 - 7.4.23, 8.0.0 - 8.0.10
/etc/. => . /etc/.. => .. /etc/pacman.d => pacman.d /etc/ld.so.conf.d => ld.so.conf.d /etc/profile.d => profile.d /etc/skel => skel /etc/php_archive.ini => php_archive.ini /etc/php.ini => php.ini /etc/localtime => localtime /etc/locale.gen => locale.gen /etc/protocols => protocols /etc/services => services /etc/arch-release => arch-release /etc/crypttab => crypttab /etc/fstab => fstab /etc/group => group /etc/gshadow => gshadow /etc/host.conf => host.conf /etc/hosts => hosts /etc/issue => issue /etc/ld.so.conf => ld.so.conf /etc/motd => motd /etc/mtab => mtab /etc/nsswitch.conf => nsswitch.conf /etc/passwd => passwd /etc/profile => profile /etc/resolv.conf => resolv.conf /etc/securetty => securetty /etc/shadow => shadow /etc/shells => shells /etc/gai.conf => gai.conf /etc/nscd.conf => nscd.conf /etc/rpc => rpc /etc/xattr.conf => xattr.conf /etc/ld.so.cache => ld.so.cache
Output for 7.3.18, 7.4.6
/etc/. => . /etc/.. => .. /etc/pacman.d => pacman.d /etc/arch-release => arch-release /etc/crypttab => crypttab /etc/fstab => fstab /etc/group => group /etc/gshadow => gshadow /etc/host.conf => host.conf /etc/hosts => hosts /etc/issue => issue /etc/ld.so.conf => ld.so.conf /etc/ld.so.conf.d => ld.so.conf.d /etc/motd => motd /etc/mtab => mtab /etc/nsswitch.conf => nsswitch.conf /etc/passwd => passwd /etc/profile => profile /etc/profile.d => profile.d /etc/resolv.conf => resolv.conf /etc/securetty => securetty /etc/shadow => shadow /etc/shells => shells /etc/skel => skel /etc/php_archive.ini => php_archive.ini /etc/php.ini => php.ini /etc/gai.conf => gai.conf /etc/nscd.conf => nscd.conf /etc/rpc => rpc /etc/localtime => localtime /etc/locale.gen => locale.gen /etc/xattr.conf => xattr.conf /etc/protocols => protocols /etc/services => services /etc/ld.so.cache => ld.so.cache
Output for 7.4.5
/etc/. => . /etc/.. => .. /etc/localtime => localtime /etc/mtab => mtab /etc/ld.so.conf.d => ld.so.conf.d /etc/pacman.d => pacman.d /etc/profile.d => profile.d /etc/skel => skel /etc/arch-release => arch-release /etc/crypttab => crypttab /etc/fstab => fstab /etc/gai.conf => gai.conf /etc/group => group /etc/gshadow => gshadow /etc/host.conf => host.conf /etc/hosts => hosts /etc/issue => issue /etc/ld.so.cache => ld.so.cache /etc/ld.so.conf => ld.so.conf /etc/locale.gen => locale.gen /etc/motd => motd /etc/nscd.conf => nscd.conf /etc/nsswitch.conf => nsswitch.conf /etc/passwd => passwd /etc/php.ini => php.ini /etc/php_archive.ini => php_archive.ini /etc/profile => profile /etc/protocols => protocols /etc/resolv.conf => resolv.conf /etc/rpc => rpc /etc/securetty => securetty /etc/services => services /etc/shadow => shadow /etc/shells => shells /etc/xattr.conf => xattr.conf
Output for 7.4.4
/etc/. => . /etc/.. => .. /etc/mtab => mtab /etc/ld.so.conf.d => ld.so.conf.d /etc/pacman.d => pacman.d /etc/profile.d => profile.d /etc/skel => skel /etc/php_archive.ini => php_archive.ini /etc/php.ini => php.ini /etc/localtime => localtime /etc/arch-release => arch-release /etc/crypttab => crypttab /etc/fstab => fstab /etc/gai.conf => gai.conf /etc/group => group /etc/gshadow => gshadow /etc/host.conf => host.conf /etc/hosts => hosts /etc/issue => issue /etc/ld.so.conf => ld.so.conf /etc/locale.gen => locale.gen /etc/motd => motd /etc/nscd.conf => nscd.conf /etc/nsswitch.conf => nsswitch.conf /etc/passwd => passwd /etc/profile => profile /etc/protocols => protocols /etc/resolv.conf => resolv.conf /etc/rpc => rpc /etc/securetty => securetty /etc/services => services /etc/shadow => shadow /etc/shells => shells /etc/xattr.conf => xattr.conf /etc/ld.so.cache => ld.so.cache
Output for 5.3.0 - 5.3.29, 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.25, 7.3.0 - 7.3.12, 7.4.0
/etc/. => . /etc/.. => .. /etc/localtime => localtime /etc/mtab => mtab /etc/hhvm => hhvm /etc/ld.so.conf.d => ld.so.conf.d /etc/pacman.d => pacman.d /etc/profile.d => profile.d /etc/skel => skel /etc/arch-release => arch-release /etc/bash.bash_logout => bash.bash_logout /etc/bash.bashrc => bash.bashrc /etc/crypttab => crypttab /etc/fstab => fstab /etc/gai.conf => gai.conf /etc/group => group /etc/gshadow => gshadow /etc/host.conf => host.conf /etc/hosts => hosts /etc/inputrc => inputrc /etc/issue => issue /etc/ld.so.conf => ld.so.conf /etc/machine-id => machine-id /etc/motd => motd /etc/nscd.conf => nscd.conf /etc/nsswitch.conf => nsswitch.conf /etc/passwd => passwd /etc/php_archive.ini => php_archive.ini /etc/profile => profile /etc/protocols => protocols /etc/rpc => rpc /etc/securetty => securetty /etc/services => services /etc/shadow => shadow /etc/shells => shells /etc/ld.so.cache => ld.so.cache /etc/locale.gen => locale.gen /etc/php.ini => php.ini /etc/resolv.conf => resolv.conf
Output for 5.1.3 - 5.1.6, 5.2.0 - 5.2.17
Fatal error: Uncaught exception 'UnexpectedValueException' with message 'RecursiveDirectoryIterator::__construct(/etc): failed to open dir: Permission denied' in /in/q3kee:3 Stack trace: #0 /in/q3kee(3): RecursiveDirectoryIterator->__construct('/etc') #1 {main} thrown in /in/q3kee on line 3
Process exited with code 255.
Output for 5.1.2
Fatal error: Uncaught exception 'RuntimeException' with message 'RecursiveDirectoryIterator::__construct(/etc): failed to open dir: Permission denied' in /in/q3kee:3 Stack trace: #0 /in/q3kee(3): RecursiveDirectoryIterator->__construct('/etc') #1 {main} thrown in /in/q3kee on line 3
Process exited with code 255.
Output for 5.1.0 - 5.1.1
Fatal error: Uncaught exception 'RuntimeException' with message 'DirectoryIterator::__construct(/etc): failed to open dir: Permission denied' in /in/q3kee:3 Stack trace: #0 /in/q3kee(3): DirectoryIterator->__construct('/etc') #1 {main} thrown in /in/q3kee on line 3
Process exited with code 255.
Output for 5.0.5
Fatal error: Uncaught exception 'Exception' with message 'DirectoryIterator::__construct(/etc): failed to open dir: Permission denied' in /in/q3kee:3 Stack trace: #0 /in/q3kee(3): DirectoryIterator->__construct('/etc') #1 {main} thrown in /in/q3kee on line 3
Process exited with code 255.
Output for 5.0.3 - 5.0.4
Fatal error: Uncaught exception 'Exception' with message 'DirectoryIterator::__construct(/etc): failed to open dir: Permission denied' in /in/q3kee:3 Stack trace: #0 /in/q3kee(3): RecursiveDirectoryIterator->__construct('/etc') #1 {main} thrown in /in/q3kee on line 3
Process exited with code 255.
Output for 5.0.0 - 5.0.2
Fatal error: Uncaught exception 'Exception' with message 'DirectoryIterator::__construct(/etc): failed to open dir: Permission denied' in /in/q3kee:3 Stack trace: #0 {main} thrown in /in/q3kee on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9
Fatal error: Cannot instantiate non-existent class: recursivedirectoryiterator in /in/q3kee on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: recursivedirectoryiterator in /in/q3kee on line 3

preferences:
276.6 ms | 401 KiB | 457 Q