3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php if (class_exists('RecursiveDirectoryIterator')) { $i1 = new RecursiveDirectoryIterator('/tmp'); $i2 = new RecursiveDirectoryIterator('/home'); foreach($i1 as $f) {} foreach($i2 as $f) {} var_dump($i1 == $i2); } else { var_dump('Class RecursiveDirectoryIterator does not exist'); }
based on YWv2n
Output for 5.0.0 - 5.5.32, 5.5.34 - 5.6.17, 5.6.20 - 7.0.3, 7.0.5 - 7.1.0
bool(true)
Output for 7.0.4
Fatal error: Uncaught UnexpectedValueException: RecursiveDirectoryIterator::__construct(/home): failed to open dir: Permission denied in /in/pggLd:5 Stack trace: #0 /in/pggLd(5): RecursiveDirectoryIterator->__construct('/home') #1 {main} thrown in /in/pggLd on line 5
Process exited with code 255.
Output for 5.5.33, 5.6.18 - 5.6.19
Fatal error: Uncaught exception 'UnexpectedValueException' with message 'RecursiveDirectoryIterator::__construct(/home): failed to open dir: Permission denied' in /in/pggLd:5 Stack trace: #0 /in/pggLd(5): RecursiveDirectoryIterator->__construct('/home') #1 {main} thrown in /in/pggLd on line 5
Process exited with code 255.
Output for 4.3.0 - 4.4.9
string(47) "Class RecursiveDirectoryIterator does not exist"