3v4l.org

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

Process exited with code 137.
Output for 5.1.0 - 7.1.7
bool(true)
Output for 5.0.0 - 5.0.5
Fatal error: Call to undefined function iterator_to_array() in /in/IE3p3 on line 7
Process exited with code 255.
Output for 4.3.0 - 4.4.9
string(47) "Class RecursiveDirectoryIterator does not exist"