3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $d = new RecursiveDirectoryIterator('.'); $tree = new RecursiveTreeIterator($d); $limit = new LimitIterator($tree, 0, 20); echo '<pre>'; foreach($limit as $element) { echo $element->getFileName() . PHP_EOL; } echo '</pre>';
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught UnexpectedValueException: RecursiveDirectoryIterator::__construct(.): failed to open dir: Permission denied in /in/Utu2E:3 Stack trace: #0 /in/Utu2E(3): RecursiveDirectoryIterator->__construct('.') #1 {main} thrown in /in/Utu2E on line 3
Process exited with code 255.
Output for 5.2.3 - 5.6.28
Fatal error: Uncaught exception 'UnexpectedValueException' with message 'RecursiveDirectoryIterator::__construct(.): failed to open dir: Permission denied' in /in/Utu2E:3 Stack trace: #0 /in/Utu2E(3): RecursiveDirectoryIterator->__construct('.') #1 {main} thrown in /in/Utu2E on line 3
Process exited with code 255.
Output for 5.1.3 - 5.2.2
<br /> <b>Fatal error</b>: Uncaught exception 'UnexpectedValueException' with message 'RecursiveDirectoryIterator::__construct(.) [&lt;a href='function.RecursiveDirectoryIterator---construct'&gt;function.RecursiveDirectoryIterator---construct&lt;/a&gt;]: failed to open dir: Permission denied' in /in/Utu2E:3 Stack trace: #0 /in/Utu2E(3): RecursiveDirectoryIterator-&gt;__construct('.') #1 {main} thrown in <b>/in/Utu2E</b> on line <b>3</b><br />
Process exited with code 255.
Output for 5.1.2
<br /> <b>Fatal error</b>: Uncaught exception 'RuntimeException' with message 'RecursiveDirectoryIterator::__construct(.) [&lt;a href='function.--construct'&gt;function.--construct&lt;/a&gt;]: failed to open dir: Permission denied' in /in/Utu2E:3 Stack trace: #0 /in/Utu2E(3): RecursiveDirectoryIterator-&gt;__construct('.') #1 {main} thrown in <b>/in/Utu2E</b> on line <b>3</b><br />
Process exited with code 255.
Output for 5.1.0 - 5.1.1
<br /> <b>Fatal error</b>: Uncaught exception 'RuntimeException' with message 'DirectoryIterator::__construct(.) [<a href='function.--construct'>function.--construct</a>]: failed to open dir: Permission denied' in /in/Utu2E:3 Stack trace: #0 /in/Utu2E(3): DirectoryIterator->__construct('.') #1 {main} thrown in <b>/in/Utu2E</b> on line <b>3</b><br />
Process exited with code 255.
Output for 5.0.5
<br /> <b>Fatal error</b>: Uncaught exception 'Exception' with message 'DirectoryIterator::__construct(.) [<a href='function.--construct'>function.--construct</a>]: failed to open dir: Permission denied' in /in/Utu2E:3 Stack trace: #0 /in/Utu2E(3): DirectoryIterator->__construct('.') #1 {main} thrown in <b>/in/Utu2E</b> on line <b>3</b><br />
Process exited with code 255.
Output for 5.0.3 - 5.0.4
<br /> <b>Fatal error</b>: Uncaught exception 'Exception' with message 'DirectoryIterator::__construct(.) [<a href='function.--construct'>function.--construct</a>]: failed to open dir: Permission denied' in /in/Utu2E:3 Stack trace: #0 /in/Utu2E(3): RecursiveDirectoryIterator->__construct('.') #1 {main} thrown in <b>/in/Utu2E</b> on line <b>3</b><br />
Process exited with code 255.
Output for 5.0.0 - 5.0.2
<br /> <b>Fatal error</b>: Uncaught exception 'Exception' with message 'DirectoryIterator::__construct(.) [<a href='function.--construct'>function.--construct</a>]: failed to open dir: Permission denied' in /in/Utu2E:3 Stack trace: #0 {main} thrown in <b>/in/Utu2E</b> on line <b>3</b><br />
Process exited with code 255.
Output for 4.3.2 - 4.4.9
<br /> <b>Fatal error</b>: Cannot instantiate non-existent class: recursivedirectoryiterator in <b>/in/Utu2E</b> on line <b>3</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.1
<br /> <b>Fatal error</b>: Cannot instantiate non-existent class: recursivedirectoryiterator in <b>/in/Utu2E</b> on line <b>3</b><br />