3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php version_compare(PHP_VERSION, '5.3.0', '>=') or die('SKIPPED'); $dir = new RecursiveDirectoryIterator('/tmp'); $dir->setMaxDepth(0); $recursive = new RecursiveIteratorIterator($dir); foreach ($recursive as $fileinfo) { printf("%s %s\n", $fileinfo, $recursive->isDot() ? "OMG A DOT!!" : ""); }
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Call to undefined method RecursiveDirectoryIterator::setMaxDepth() in /in/vrZPt:4 Stack trace: #0 {main} thrown in /in/vrZPt on line 4
Process exited with code 255.
Output for hhvm-3.12.0
Fatal error: Uncaught Error: Call to undefined method RecursiveDirectoryIterator::setMaxDepth() in /in/vrZPt:4 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.3.0 - 5.6.28, hhvm-3.10.0
Fatal error: Call to undefined method RecursiveDirectoryIterator::setMaxDepth() in /in/vrZPt on line 4
Process exited with code 255.
Output for 4.3.0 - 5.2.17
SKIPPED