3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php mkdir('/tmp/test' . mt_rand()); $iterator = new RecursiveDirectoryIterator('/tmp/test'); foreach ($iterator as $path => $file) var_dump($path);
Output for 7.0.12 - 7.1.0
Fatal error: Uncaught UnexpectedValueException: RecursiveDirectoryIterator::__construct(/tmp/test): failed to open dir: No such file or directory in /in/C90LA:5 Stack trace: #0 /in/C90LA(5): RecursiveDirectoryIterator->__construct('/tmp/test') #1 {main} thrown in /in/C90LA on line 5
Process exited with code 255.
Output for 5.5.24 - 5.5.26, 5.6.8 - 5.6.9, 5.6.20, 7.0.1, 7.0.6
string(11) "/tmp/test/." string(12) "/tmp/test/.." string(21) "/tmp/test/example.txt" string(16) "/tmp/test/folder" string(19) "/tmp/test/file1.php" string(15) "/tmp/test/mydir" string(20) "/tmp/test/.anyhidden"
Output for 5.5.29, 5.6.10, 5.6.13, 5.6.21, 7.0.4 - 7.0.5
string(11) "/tmp/test/." string(12) "/tmp/test/.." string(15) "/tmp/test/mydir" string(20) "/tmp/test/.anyhidden"
Output for 7.0.0, 7.0.2 - 7.0.3
Fatal error: Uncaught UnexpectedValueException: RecursiveDirectoryIterator::__construct(/tmp/test): failed to open dir: Not a directory in /in/C90LA:5 Stack trace: #0 /in/C90LA(5): RecursiveDirectoryIterator->__construct('/tmp/test') #1 {main} thrown in /in/C90LA on line 5
Process exited with code 255.
Output for 5.1.3 - 5.4.45, 5.6.7, 5.6.19, 5.6.28
Fatal error: Uncaught exception 'UnexpectedValueException' with message 'RecursiveDirectoryIterator::__construct(/tmp/test): failed to open dir: No such file or directory' in /in/C90LA:5 Stack trace: #0 /in/C90LA(5): RecursiveDirectoryIterator->__construct('/tmp/test') #1 {main} thrown in /in/C90LA on line 5
Process exited with code 255.
Output for 5.5.27 - 5.5.28, 5.5.30 - 5.5.35, 5.6.11 - 5.6.12, 5.6.14 - 5.6.18
Fatal error: Uncaught exception 'UnexpectedValueException' with message 'RecursiveDirectoryIterator::__construct(/tmp/test): failed to open dir: Not a directory' in /in/C90LA:5 Stack trace: #0 /in/C90LA(5): RecursiveDirectoryIterator->__construct('/tmp/test') #1 {main} thrown in /in/C90LA on line 5
Process exited with code 255.
Output for 5.1.2
Fatal error: Uncaught exception 'RuntimeException' with message 'RecursiveDirectoryIterator::__construct(/tmp/test): failed to open dir: No such file or directory' in /in/C90LA:5 Stack trace: #0 /in/C90LA(5): RecursiveDirectoryIterator->__construct('/tmp/test') #1 {main} thrown in /in/C90LA on line 5
Process exited with code 255.
Output for 5.1.0 - 5.1.1
Fatal error: Uncaught exception 'RuntimeException' with message 'DirectoryIterator::__construct(/tmp/test): failed to open dir: No such file or directory' in /in/C90LA:5 Stack trace: #0 /in/C90LA(5): DirectoryIterator->__construct('/tmp/test') #1 {main} thrown in /in/C90LA on line 5
Process exited with code 255.
Output for 5.0.5
Fatal error: Uncaught exception 'Exception' with message 'DirectoryIterator::__construct(/tmp/test): failed to open dir: No such file or directory' in /in/C90LA:5 Stack trace: #0 /in/C90LA(5): DirectoryIterator->__construct('/tmp/test') #1 {main} thrown in /in/C90LA on line 5
Process exited with code 255.
Output for 5.0.3 - 5.0.4
Fatal error: Uncaught exception 'Exception' with message 'DirectoryIterator::__construct(/tmp/test): failed to open dir: No such file or directory' in /in/C90LA:5 Stack trace: #0 /in/C90LA(5): RecursiveDirectoryIterator->__construct('/tmp/test') #1 {main} thrown in /in/C90LA on line 5
Process exited with code 255.
Output for 5.0.0 - 5.0.2
Fatal error: Uncaught exception 'Exception' with message 'DirectoryIterator::__construct(/tmp/test): failed to open dir: No such file or directory' in /in/C90LA:5 Stack trace: #0 {main} thrown in /in/C90LA on line 5
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: recursivedirectoryiterator in /in/C90LA on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: recursivedirectoryiterator in /in/C90LA on line 5