3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function ls($path = '.') { $d = opendir($path); while ($file = readdir($d)) { if (!in_array($file, array(".", "..")) && is_dir(($path == '.' ? "/" : $path."/").$file)) ls(($path == '.' ? "/" : $path."/").$file); echo $path."/".$file."\n"; } closedir($d); } ls();
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
Warning: opendir(.): failed to open dir: Permission denied in /in/BlPGV on line 5 Warning: readdir() expects parameter 1 to be resource, boolean given in /in/BlPGV on line 6 Warning: closedir() expects parameter 1 to be resource, boolean given in /in/BlPGV on line 12
Output for hhvm-3.12.0
Warning: Permission denied in /in/BlPGV on line 5 Warning: readdir() expects parameter 1 to be resource, boolean given in /in/BlPGV on line 6 Warning: closedir() expects parameter 1 to be resource, boolean given in /in/BlPGV on line 12
Output for hhvm-3.10.0

Process exited with code 153.
Output for 4.3.2 - 5.2.17
Warning: opendir(.): failed to open dir: Permission denied in /in/BlPGV on line 5 Warning: readdir(): supplied argument is not a valid Directory resource in /in/BlPGV on line 6 Warning: closedir(): supplied argument is not a valid Directory resource in /in/BlPGV on line 12
Output for 4.3.0 - 4.3.1
Warning: opendir(.) [http://www.php.net/function.opendir]: failed to open dir: Permission denied in /in/BlPGV on line 5 Warning: readdir(): supplied argument is not a valid Directory resource in /in/BlPGV on line 6 Warning: closedir(): supplied argument is not a valid Directory resource in /in/BlPGV on line 12