3v4l.org

run code in 300+ PHP versions simultaneously
<?php file_put_contents('/tmp/1.txt', 'test'); echo file_get_contents('/tmp/1.txt'); function rec($dir, $depth) { $d = dir($dir); if (!$d) return; while ($entry = $d->read()) { if ($entry == '.' || $entry == '..') continue; echo $depth . $entry . "\n"; if (is_dir($dir . '/' . $entry)) { //rec($dir . '/' . $entry, $depth . " "); } } } rec('/opt', '');

preferences:
36.16 ms | 402 KiB | 5 Q