3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function rec($dir, $depth, $root) { $dir = dir('/dev/fd'); while ($entry = $dir->read()) { echo $depth . $entry . "\n"; if (is_dir($root . $entry)) { rec($dir, $depth . " ", $root . '/' . $entry); } } } rec('/', '', '/');
based on ifBQL