3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php if (class_exists('RecursiveDirectoryIterator')) { $i1 = new RecursiveDirectoryIterator('/tmp'); var_dump($i1); } else { var_dump('Class RecursiveDirectoryIterator does not exist'); }
based on 7aZBs
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
object(RecursiveDirectoryIterator)#1 (4) { ["pathName":"SplFileInfo":private]=> string(6) "/tmp/." ["fileName":"SplFileInfo":private]=> string(1) "." ["glob":"DirectoryIterator":private]=> bool(false) ["subPathName":"RecursiveDirectoryIterator":private]=> string(0) "" }
Output for hhvm-3.10.0 - 3.12.0
object(RecursiveDirectoryIterator)#1 (8) { ["subPath":"RecursiveDirectoryIterator":private]=> NULL ["flags":protected]=> int(0) ["dir":"DirectoryIterator":private]=> resource(4) of type (Directory) ["dirName":"DirectoryIterator":private]=> string(4) "/tmp" ["index":"DirectoryIterator":private]=> int(0) ["fileName":"SplFileInfo":private]=> string(6) "/tmp/." ["fileClass":"SplFileInfo":private]=> string(13) "SplFileObject" ["infoClass":"SplFileInfo":private]=> string(11) "SplFileInfo" }
Output for 5.0.0 - 5.2.17
object(RecursiveDirectoryIterator)#1 (0) { }
Output for 4.3.0 - 4.4.9
string(47) "Class RecursiveDirectoryIterator does not exist"