3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator('/var'), 1, 16); foreach ($iterator as $path) { print $path->__toString() . PHP_EOL; }
Output for 7.1.0
/var/. /var/.. /var/cache /var/cache/. /var/cache/.. /var/cache/fontconfig /var/cache/fontconfig/. /var/cache/fontconfig/.. /var/cache/fontconfig/CACHEDIR.TAG /var/cache/ldconfig /var/cache/pacman /var/db /var/db/. /var/db/.. /var/db/Makefile /var/empty /var/empty/. /var/empty/.. /var/games /var/games/. /var/games/.. /var/lib /var/lib/. /var/lib/.. /var/lib/krb5kdc /var/lib/krb5kdc/. /var/lib/krb5kdc/.. /var/lib/krb5kdc/kdc.conf /var/lib/machines /var/lib/misc /var/lib/misc/. /var/lib/misc/.. /var/lib/pacman /var/local /var/local/. /var/local/.. /var/log /var/log/. /var/log/.. /var/log/old /var/log/old/. /var/log/old/.. /var/log/journal /var/log/journal/. /var/log/journal/.. /var/log/journal/df58ce95805a4e5e8598c70592c99a71 /var/log/journal/df58ce95805a4e5e8598c70592c99a71/. /var/log/journal/df58ce95805a4e5e8598c70592c99a71/.. /var/log/pacman.log /var/opt /var/opt/. /var/opt/.. /var/spool /var/spool/. /var/spool/.. /var/spool/mail /var/spool/mail/. /var/spool/mail/.. /var/tmp /var/tmp/. /var/tmp/.. /var/tmp/hhbc-1a98688c77d0d3c9fbbefdba4ff634e985503867.sqlite3 /var/tmp/hhbc-479647c3ad87f2e920ac085aa1424e2b8101da45.sqlite3 /var/tmp/hhbc-4df25a721704eccd6ec92e0cc3fa2d7e34f1fbf9.sqlite3 /var/tmp/hhbc-5be9b3e8f9639ac359987b8d6e27ecd59de500dd.sqlite3 /var/tmp/hhbc-64ef2f0cc202814e416e93ed6335e2ff627a2207.sqlite3 /var/tmp/hhbc-8504c2e848bc8a3ed7a5698ca9c06f658ac9779b.sqlite3 /var/tmp/hhbc-862bd51c10a685e6bd9f97430146a9d3fa16aed9.sqlite3 /var/tmp/hhbc-ad53673037439e3b77b6a64cb21ec130ec69c4d2.sqlite3 /var/tmp/hhbc-f6de3214edab8aa7570be68f12317f40bfe1221d.sqlite3 /var/tmp/hhbc-fd53a034d154553fb52ef0fc54dbe49ff1c7c10b.sqlite3 /var/mail /var/lock /var/run
Output for 5.6.28, 7.0.14
/var/. /var/.. /var/cache /var/cache/. /var/cache/.. /var/cache/fontconfig /var/cache/fontconfig/. /var/cache/fontconfig/.. /var/cache/fontconfig/CACHEDIR.TAG /var/cache/ldconfig /var/cache/pacman /var/db /var/db/. /var/db/.. /var/db/Makefile /var/empty /var/empty/. /var/empty/.. /var/games /var/games/. /var/games/.. /var/lib /var/lib/. /var/lib/.. /var/lib/krb5kdc /var/lib/krb5kdc/. /var/lib/krb5kdc/.. /var/lib/krb5kdc/kdc.conf /var/lib/machines /var/lib/misc /var/lib/misc/. /var/lib/misc/.. /var/lib/pacman /var/local /var/local/. /var/local/.. /var/log /var/log/. /var/log/.. /var/log/old /var/log/old/. /var/log/old/.. /var/log/pacman.log /var/opt /var/opt/. /var/opt/.. /var/spool /var/spool/. /var/spool/.. /var/spool/mail /var/spool/mail/. /var/spool/mail/.. /var/tmp /var/tmp/. /var/tmp/.. /var/tmp/hhbc-1a98688c77d0d3c9fbbefdba4ff634e985503867.sqlite3 /var/tmp/hhbc-479647c3ad87f2e920ac085aa1424e2b8101da45.sqlite3 /var/tmp/hhbc-4df25a721704eccd6ec92e0cc3fa2d7e34f1fbf9.sqlite3 /var/tmp/hhbc-5be9b3e8f9639ac359987b8d6e27ecd59de500dd.sqlite3 /var/tmp/hhbc-64ef2f0cc202814e416e93ed6335e2ff627a2207.sqlite3 /var/tmp/hhbc-8504c2e848bc8a3ed7a5698ca9c06f658ac9779b.sqlite3 /var/tmp/hhbc-862bd51c10a685e6bd9f97430146a9d3fa16aed9.sqlite3 /var/tmp/hhbc-ad53673037439e3b77b6a64cb21ec130ec69c4d2.sqlite3 /var/tmp/hhbc-f6de3214edab8aa7570be68f12317f40bfe1221d.sqlite3 /var/tmp/hhbc-fd53a034d154553fb52ef0fc54dbe49ff1c7c10b.sqlite3 /var/mail /var/lock /var/run
Output for 5.3.23 - 5.3.29, 5.4.5 - 5.6.22, 7.0.0 - 7.0.7
/var/. /var/.. /var/lock /var/mail /var/run /var/cache /var/cache/. /var/cache/.. /var/cache/fontconfig /var/cache/fontconfig/. /var/cache/fontconfig/.. /var/cache/fontconfig/CACHEDIR.TAG /var/cache/ldconfig /var/cache/pacman /var/db /var/db/. /var/db/.. /var/db/Makefile /var/empty /var/empty/. /var/empty/.. /var/games /var/games/. /var/games/.. /var/lib /var/lib/. /var/lib/.. /var/lib/krb5kdc /var/lib/krb5kdc/. /var/lib/krb5kdc/.. /var/lib/krb5kdc/kdc.conf /var/lib/machines /var/lib/misc /var/lib/misc/. /var/lib/misc/.. /var/lib/pacman /var/local /var/local/. /var/local/.. /var/log /var/log/. /var/log/.. /var/log/old /var/log/old/. /var/log/old/.. /var/log/pacman.log /var/opt /var/opt/. /var/opt/.. /var/spool /var/spool/. /var/spool/.. /var/spool/mail /var/spool/mail/. /var/spool/mail/.. /var/tmp /var/tmp/. /var/tmp/.. /var/tmp/hhbc-1a98688c77d0d3c9fbbefdba4ff634e985503867.sqlite3 /var/tmp/hhbc-479647c3ad87f2e920ac085aa1424e2b8101da45.sqlite3 /var/tmp/hhbc-4df25a721704eccd6ec92e0cc3fa2d7e34f1fbf9.sqlite3 /var/tmp/hhbc-5be9b3e8f9639ac359987b8d6e27ecd59de500dd.sqlite3 /var/tmp/hhbc-64ef2f0cc202814e416e93ed6335e2ff627a2207.sqlite3 /var/tmp/hhbc-8504c2e848bc8a3ed7a5698ca9c06f658ac9779b.sqlite3 /var/tmp/hhbc-f6de3214edab8aa7570be68f12317f40bfe1221d.sqlite3
Output for hhvm-3.10.0 - 3.12.0
/var/. /var/.. /var/lock /var/mail /var/run /var/cache /var/cache/. /var/cache/.. /var/cache/fontconfig /var/cache/fontconfig/. /var/cache/fontconfig/.. /var/cache/fontconfig/CACHEDIR.TAG /var/cache/ldconfig Fatal error: Uncaught exception 'UnexpectedValueException' with message 'DirectoryIterator::__construct(/var/cache/ldconfig): failed to open dir' in /in/ojkN7:6 Stack trace: #0 /in/ojkN7(6): RecursiveIteratorIterator->next() #1 {main}
Process exited with code 255.
Output for 5.2.0 - 5.3.22, 5.4.0 - 5.4.4
/var/lock /var/mail /var/run /var/cache /var/cache/fontconfig /var/cache/fontconfig/CACHEDIR.TAG /var/cache/ldconfig /var/cache/pacman /var/db /var/db/Makefile /var/empty /var/games /var/lib /var/lib/krb5kdc /var/lib/krb5kdc/kdc.conf /var/lib/machines /var/lib/misc /var/lib/pacman /var/local /var/log /var/log/old /var/log/pacman.log /var/opt /var/spool /var/spool/mail /var/tmp /var/tmp/hhbc-1a98688c77d0d3c9fbbefdba4ff634e985503867.sqlite3 /var/tmp/hhbc-479647c3ad87f2e920ac085aa1424e2b8101da45.sqlite3 /var/tmp/hhbc-4df25a721704eccd6ec92e0cc3fa2d7e34f1fbf9.sqlite3 /var/tmp/hhbc-5be9b3e8f9639ac359987b8d6e27ecd59de500dd.sqlite3 /var/tmp/hhbc-64ef2f0cc202814e416e93ed6335e2ff627a2207.sqlite3 /var/tmp/hhbc-8504c2e848bc8a3ed7a5698ca9c06f658ac9779b.sqlite3 /var/tmp/hhbc-f6de3214edab8aa7570be68f12317f40bfe1221d.sqlite3
Output for 5.1.3 - 5.1.6
/var/lock /var/mail /var/run /var/cache /var/cache/fontconfig /var/cache/fontconfig/CACHEDIR.TAG /var/cache/ldconfig Fatal error: Uncaught exception 'UnexpectedValueException' with message 'RecursiveDirectoryIterator::__construct(/var/cache/ldconfig): failed to open dir: Permission denied' in /in/ojkN7:4 Stack trace: #0 [internal function]: RecursiveDirectoryIterator->__construct('/var/cache/ldco...') #1 /in/ojkN7(4): RecursiveDirectoryIterator->getChildren() #2 {main} thrown in /in/ojkN7 on line 4
Process exited with code 255.
Output for 5.1.2
/var/lock /var/mail /var/run /var/cache /var/cache/fontconfig /var/cache/fontconfig/CACHEDIR.TAG /var/cache/ldconfig Fatal error: Uncaught exception 'RuntimeException' with message 'RecursiveDirectoryIterator::__construct(/var/cache/ldconfig): failed to open dir: Permission denied' in /in/ojkN7:4 Stack trace: #0 [internal function]: RecursiveDirectoryIterator::__construct('/var/cache/ldco...') #1 /in/ojkN7(4): RecursiveDirectoryIterator::getChildren() #2 {main} thrown in /in/ojkN7 on line 4
Process exited with code 255.
Output for 5.1.0 - 5.1.1
lock mail run cache fontconfig CACHEDIR.TAG ldconfig Fatal error: Uncaught exception 'RuntimeException' with message 'DirectoryIterator::__construct(/var/cache/ldconfig): failed to open dir: Permission denied' in /in/ojkN7:4 Stack trace: #0 [internal function]: DirectoryIterator::__construct('/var/cache/ldco...') #1 /in/ojkN7(4): RecursiveDirectoryIterator::getChildren() #2 {main} thrown in /in/ojkN7 on line 4
Process exited with code 255.
Output for 5.0.3 - 5.0.5
Fatal error: Uncaught exception 'Exception' with message 'RecursiveIteratorIterator::__construct() expects at most 2 parameters, 3 given' in /in/ojkN7:3 Stack trace: #0 /in/ojkN7(3): RecursiveIteratorIterator->__construct(Object(RecursiveDirectoryIterator), 1, 16) #1 {main} thrown in /in/ojkN7 on line 3
Process exited with code 255.
Output for 5.0.0 - 5.0.2
Fatal error: Uncaught exception 'Exception' with message 'RecursiveIteratorIterator::__construct() expects at most 2 parameters, 3 given' in /in/ojkN7:3 Stack trace: #0 {main} thrown in /in/ojkN7 on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: recursiveiteratoriterator in /in/ojkN7 on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: recursiveiteratoriterator in /in/ojkN7 on line 3