3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php if (class_exists('RecursiveDirectoryIterator')) { $i1 = new RecursiveDirectoryIterator('/tmp'); $i2 = new RecursiveDirectoryIterator('/home'); var_dump($i1 == $i2); } else { var_dump('Class RecursiveDirectoryIterator does not exist'); }
based on 8Uacn
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/YWv2n:5 Stack trace: #0 /in/YWv2n(5): RecursiveDirectoryIterator->__construct('/home') #1 {main} thrown in /in/YWv2n 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/YWv2n:5 Stack trace: #0 /in/YWv2n(5): RecursiveDirectoryIterator->__construct('/home') #1 {main} thrown in /in/YWv2n on line 5
Process exited with code 255.
Output for 4.3.0 - 4.4.9
string(47) "Class RecursiveDirectoryIterator does not exist"