3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php system('help'); 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('/root', '');
based on ZV6HA
Output for 5.4.39 - 5.6.28, 7.0.0 - 7.1.0
Warning: dir(/root): failed to open dir: Permission denied in /in/aUXkY on line 4
Output for hhvm-3.10.0 - 3.12.0
Failed to exec: `help' Warning: Permission denied in /in/aUXkY on line 4
Output for 4.3.2 - 5.4.38
Warning: dir(/root): failed to open dir: Permission denied in /in/aUXkY on line 4 sh: 1: help: not found
Output for 4.3.1
Warning: dir(/root) [http://www.php.net/function.dir]: failed to open dir: Permission denied in /in/aUXkY on line 4 sh: 1: help: not found
Output for 4.3.0
Warning: dir(/root) [http://www.php.net/function.dir]: failed to open dir: Permission denied in /in/aUXkY on line 4