3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php if (class_exists('RecursiveDirectoryIterator')) { $i1 = new RecursiveDirectoryIterator('/tmp'); $i2 = new RecursiveDirectoryIterator('/home'); foreach($i1 as $f) { var_dump((string) $f); } foreach($i2 as $f) { var_dump((string) $f); } var_dump($i1 == $i2); } else { var_dump('Class RecursiveDirectoryIterator does not exist'); }
based on pggLd
Output for 7.2.0
Fatal error: Uncaught UnexpectedValueException: RecursiveDirectoryIterator::__construct(/home): failed to open dir: Permission denied in /in/baBjg:5 Stack trace: #0 /in/baBjg(5): RecursiveDirectoryIterator->__construct('/home') #1 {main} thrown in /in/baBjg on line 5
Process exited with code 255.
Output for 5.4.5 - 7.1.10
string(6) "/tmp/." string(7) "/tmp/.." string(7) "/home/." string(8) "/home/.." bool(true)
Output for 5.4.0 - 5.4.4
bool(true)