3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php if (class_exists('RecursiveDirectoryIterator')) { $i1 = new RecursiveDirectoryIterator(__DIR__); $i2 = new RecursiveDirectoryIterator(__DIR__ . '/..'); var_dump($i1 == $i2); } else { var_dump('Class RecursiveDirectoryIterator does not exist'); }
based on JgUPO
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught UnexpectedValueException: RecursiveDirectoryIterator::__construct(/in): failed to open dir: Permission denied in /in/JIJuW:4 Stack trace: #0 /in/JIJuW(4): RecursiveDirectoryIterator->__construct('/in') #1 {main} thrown in /in/JIJuW on line 4
Process exited with code 255.
Output for 5.3.0 - 5.6.28
Fatal error: Uncaught exception 'UnexpectedValueException' with message 'RecursiveDirectoryIterator::__construct(/in): failed to open dir: Permission denied' in /in/JIJuW:4 Stack trace: #0 /in/JIJuW(4): RecursiveDirectoryIterator->__construct('/in') #1 {main} thrown in /in/JIJuW on line 4
Process exited with code 255.
Output for 5.1.3 - 5.2.17
Notice: Use of undefined constant __DIR__ - assumed '__DIR__' in /in/JIJuW on line 4 Fatal error: Uncaught exception 'UnexpectedValueException' with message 'RecursiveDirectoryIterator::__construct(__DIR__): failed to open dir: No such file or directory' in /in/JIJuW:4 Stack trace: #0 /in/JIJuW(4): RecursiveDirectoryIterator->__construct('__DIR__') #1 {main} thrown in /in/JIJuW on line 4
Process exited with code 255.
Output for 5.1.2
Notice: Use of undefined constant __DIR__ - assumed '__DIR__' in /in/JIJuW on line 4 Fatal error: Uncaught exception 'RuntimeException' with message 'RecursiveDirectoryIterator::__construct(__DIR__): failed to open dir: No such file or directory' in /in/JIJuW:4 Stack trace: #0 /in/JIJuW(4): RecursiveDirectoryIterator->__construct('__DIR__') #1 {main} thrown in /in/JIJuW on line 4
Process exited with code 255.
Output for 5.1.0 - 5.1.1
Notice: Use of undefined constant __DIR__ - assumed '__DIR__' in /in/JIJuW on line 4 Fatal error: Uncaught exception 'RuntimeException' with message 'DirectoryIterator::__construct(__DIR__): failed to open dir: No such file or directory' in /in/JIJuW:4 Stack trace: #0 /in/JIJuW(4): DirectoryIterator->__construct('__DIR__') #1 {main} thrown in /in/JIJuW on line 4
Process exited with code 255.
Output for 5.0.5
Notice: Use of undefined constant __DIR__ - assumed '__DIR__' in /in/JIJuW on line 4 Fatal error: Uncaught exception 'Exception' with message 'DirectoryIterator::__construct(__DIR__): failed to open dir: No such file or directory' in /in/JIJuW:4 Stack trace: #0 /in/JIJuW(4): DirectoryIterator->__construct('__DIR__') #1 {main} thrown in /in/JIJuW on line 4
Process exited with code 255.
Output for 5.0.3 - 5.0.4
Notice: Use of undefined constant __DIR__ - assumed '__DIR__' in /in/JIJuW on line 4 Fatal error: Uncaught exception 'Exception' with message 'DirectoryIterator::__construct(__DIR__): failed to open dir: No such file or directory' in /in/JIJuW:4 Stack trace: #0 /in/JIJuW(4): RecursiveDirectoryIterator->__construct('__DIR__') #1 {main} thrown in /in/JIJuW on line 4
Process exited with code 255.
Output for 5.0.0 - 5.0.2
Notice: Use of undefined constant __DIR__ - assumed '__DIR__' in /in/JIJuW on line 4 Fatal error: Uncaught exception 'Exception' with message 'DirectoryIterator::__construct(__DIR__): failed to open dir: No such file or directory' in /in/JIJuW:4 Stack trace: #0 {main} thrown in /in/JIJuW on line 4
Process exited with code 255.
Output for 4.3.0 - 4.4.9
string(47) "Class RecursiveDirectoryIterator does not exist"