3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php if($a = opendir(".")){ while($b = readdir($a)){ sort($b); if(is_file($b)){ if(is_writable($b)){ echo "File ".$b." is writable\n"; } else { echo "File ".$b." is not writable\n"; } } elseif(is_dir($b)){ if(is_writable($b)){ echo "DIR ".$b." is writable\n"; } else { echo "DIR ".$b." is not writable\n"; } } } } else { echo "Can't opendir()"; } ?>
Output for 4.3.2 - 7.2.0
Warning: opendir(.): failed to open dir: Permission denied in /in/Nkr8S on line 2 Can't opendir()
Output for 4.3.0 - 4.3.1
Warning: opendir(.) [http://www.php.net/function.opendir]: failed to open dir: Permission denied in /in/Nkr8S on line 2 Can't opendir()