3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php // unbroken loop function segfault($r) { foreach($r as $v) { segfault($v); } } $directoryIterator = new DirectoryIterator(__DIR__); segfault($directoryIterator);
Output for 7.0.0 - 7.3.0alpha1
Fatal error: Uncaught UnexpectedValueException: DirectoryIterator::__construct(/in): failed to open dir: Permission denied in /in/3Obnd:8 Stack trace: #0 /in/3Obnd(8): DirectoryIterator->__construct('/in') #1 {main} thrown in /in/3Obnd on line 8
Process exited with code 255.
Output for 5.3.0 - 5.6.28
Fatal error: Uncaught exception 'UnexpectedValueException' with message 'DirectoryIterator::__construct(/in): failed to open dir: Permission denied' in /in/3Obnd:8 Stack trace: #0 /in/3Obnd(8): DirectoryIterator->__construct('/in') #1 {main} thrown in /in/3Obnd on line 8
Process exited with code 255.
Output for 5.1.0 - 5.2.17
Notice: Use of undefined constant __DIR__ - assumed '__DIR__' in /in/3Obnd on line 8 Fatal error: Uncaught exception 'RuntimeException' with message 'DirectoryIterator::__construct(__DIR__): failed to open dir: No such file or directory' in /in/3Obnd:8 Stack trace: #0 /in/3Obnd(8): DirectoryIterator->__construct('__DIR__') #1 {main} thrown in /in/3Obnd on line 8
Process exited with code 255.
Output for 5.0.3 - 5.0.5
Notice: Use of undefined constant __DIR__ - assumed '__DIR__' in /in/3Obnd on line 8 Fatal error: Uncaught exception 'Exception' with message 'DirectoryIterator::__construct(__DIR__): failed to open dir: No such file or directory' in /in/3Obnd:8 Stack trace: #0 /in/3Obnd(8): DirectoryIterator->__construct('__DIR__') #1 {main} thrown in /in/3Obnd on line 8
Process exited with code 255.
Output for 5.0.0 - 5.0.2
Notice: Use of undefined constant __DIR__ - assumed '__DIR__' in /in/3Obnd on line 8 Fatal error: Uncaught exception 'Exception' with message 'DirectoryIterator::__construct(__DIR__): failed to open dir: No such file or directory' in /in/3Obnd:8 Stack trace: #0 {main} thrown in /in/3Obnd on line 8
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: directoryiterator in /in/3Obnd on line 8
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: directoryiterator in /in/3Obnd on line 8