3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $d = dir('.'); foreach($d as $entry){ echo "$entry\n"; }
based on a39OP
Output for 4.3.2 - 4.3.10, 4.4.0 - 7.2.0
Warning: dir(.): failed to open dir: Permission denied in /in/QrE6T on line 3 Warning: Invalid argument supplied for foreach() in /in/QrE6T on line 4
Output for 4.3.11
Warning: dir(.): failed to open dir: Permission denied in /in/QrE6T on line 3
Output for 4.3.0 - 4.3.1
Warning: dir(.) [http://www.php.net/function.dir]: failed to open dir: Permission denied in /in/QrE6T on line 3 Warning: Invalid argument supplied for foreach() in /in/QrE6T on line 4