3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $iter = new RecursiveIteratorIterator(new RecursiveDirectoryIterator('/', FilesystemIterator::SKIP_DOTS)); foreach ($iter as $filename) { echo sprintf("%s % 10d %s %s\n", str_pad($filename, 80, ' ', STR_PAD_RIGHT), filesize($filename), date('r', filemtime($filename)), decoct(fileperms($filename)) ); }
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught UnexpectedValueException: RecursiveDirectoryIterator::__construct(/): failed to open dir: Permission denied in /in/qFMqb:3 Stack trace: #0 /in/qFMqb(3): RecursiveDirectoryIterator->__construct('/', 4096) #1 {main} thrown in /in/qFMqb on line 3
Process exited with code 255.
Output for 5.3.0 - 5.6.28
Fatal error: Uncaught exception 'UnexpectedValueException' with message 'RecursiveDirectoryIterator::__construct(/): failed to open dir: Permission denied' in /in/qFMqb:3 Stack trace: #0 /in/qFMqb(3): RecursiveDirectoryIterator->__construct('/', 4096) #1 {main} thrown in /in/qFMqb on line 3
Process exited with code 255.