3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php if($a = opendir(".")){ while($b = readdir($a)){ 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 - 5.6.28, 7.0.0 - 7.1.0
Warning: opendir(.): failed to open dir: Permission denied in /in/YBItP on line 2 Can't opendir()
Output for hhvm-3.10.0 - 3.12.0
Warning: Permission denied in /in/YBItP 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/YBItP on line 2 Can't opendir()