3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php if ($handle = opendir('/')) { echo "Directory handle: $handle\n"; echo "Entries:\n"; /* This is the correct way to loop over the directory. */ while (false !== ($entry = readdir($handle))) { echo "$entry\n"; } /* This is the WRONG way to loop over the directory. */ while ($entry = readdir($handle)) { echo "$entry\n"; } closedir($handle); }
Output for 4.3.2 - 7.1.0
Warning: opendir(/): failed to open dir: Permission denied in /in/o3QRn on line 2
Output for 4.3.0 - 4.3.1
Warning: opendir(/) [http://www.php.net/function.opendir]: failed to open dir: Permission denied in /in/o3QRn on line 2