3v4l.org

run code in 300+ PHP versions simultaneously
<?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'); }
Output for 7.2.29 - 7.2.33, 7.3.16 - 7.3.29, 7.4.3 - 7.4.16, 7.4.21 - 7.4.22, 7.4.26 - 7.4.32, 8.0.0, 8.0.2 - 8.0.3, 8.0.7 - 8.0.9, 8.0.14 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: Uncaught UnexpectedValueException: RecursiveDirectoryIterator::__construct(): open_basedir restriction in effect. File(/in/..) is not within the allowed path(s): (/tmp:/in:/etc) in /in/JIJuW:5 Stack trace: #0 /in/JIJuW(5): RecursiveDirectoryIterator->__construct('/in/..') #1 {main} thrown in /in/JIJuW on line 5
Process exited with code 255.
Output for 7.3.33, 7.4.33, 8.0.13
bool(true)
Output for 8.0.1, 8.0.5 - 8.0.6, 8.0.10 - 8.0.12
Fatal error: Uncaught UnexpectedValueException: RecursiveDirectoryIterator::__construct(/in): Failed to open directory: 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 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.25, 7.3.0 - 7.3.12, 7.3.30 - 7.3.32, 7.4.0, 7.4.20, 7.4.23 - 7.4.25
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.3.29, 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.8 - 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.1.6, 5.2.0 - 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.3.11, 4.4.0 - 4.4.9
string(47) "Class RecursiveDirectoryIterator does not exist"

preferences:
209.53 ms | 402 KiB | 355 Q