3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php if ($handle = opendir('/home')) { 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"; } closedir($handle); }
based on PfcdG
Output for 7.1.25 - 7.3.1
Warning: opendir(): open_basedir restriction in effect. File(/home) is not within the allowed path(s): (/tmp:/in:/etc) in /in/Zvbd9 on line 3 Warning: opendir(/home): failed to open dir: Operation not permitted in /in/Zvbd9 on line 3
Output for 7.1.20
Warning: opendir(): open_basedir restriction in effect. File(/home) is not within the allowed path(s): (/tmp:/in) in /in/Zvbd9 on line 3 Warning: opendir(/home): failed to open dir: Operation not permitted in /in/Zvbd9 on line 3
Output for 5.3.0 - 7.1.10
Directory handle: Resource id #5 Entries: . ..
Output for 5.2.3 - 5.2.17
Directory handle: Resource id #4 Entries: . ..
Output for 4.3.0 - 5.2.2
Directory handle: Resource id #1 Entries: . ..