3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $arr = array(); foreach(new DirectoryIterator(dirname(__FILE__)) as $dir) { $arr[] = $dir->getFilename(); } var_dump($arr);
based on PerHn
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught UnexpectedValueException: DirectoryIterator::__construct(/in): failed to open dir: Permission denied in /in/288EX:4 Stack trace: #0 /in/288EX(4): DirectoryIterator->__construct('/in') #1 {main} thrown in /in/288EX on line 4
Process exited with code 255.
Output for 5.3.19 - 5.6.28
Fatal error: Uncaught exception 'UnexpectedValueException' with message 'DirectoryIterator::__construct(/in): failed to open dir: Permission denied' in /in/288EX:4 Stack trace: #0 /in/288EX(4): DirectoryIterator->__construct('/in') #1 {main} thrown in /in/288EX on line 4
Process exited with code 255.