3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $dir = "./usr"; // Open a known directory, and proceed to read its contents if (is_dir($dir)) { if ($dh = opendir($dir)) { while (($file = readdir($dh)) !== false) { echo "filename: $file : filetype: " . filetype($dir . $file) . "\n"; } closedir($dh); } }
Output for 5.6.28, 7.0.14 - 7.1.0
Warning: filetype(): Lstat failed for ./usr. in /in/942Mj on line 8 filename: . : filetype: Warning: filetype(): Lstat failed for ./usr.. in /in/942Mj on line 8 filename: .. : filetype: Warning: filetype(): Lstat failed for ./usrbin in /in/942Mj on line 8 filename: bin : filetype: Warning: filetype(): Lstat failed for ./usrinclude in /in/942Mj on line 8 filename: include : filetype: Warning: filetype(): Lstat failed for ./usrlib in /in/942Mj on line 8 filename: lib : filetype: Warning: filetype(): Lstat failed for ./usrlocal in /in/942Mj on line 8 filename: local : filetype: Warning: filetype(): Lstat failed for ./usrshare in /in/942Mj on line 8 filename: share : filetype: Warning: filetype(): Lstat failed for ./usrsrc in /in/942Mj on line 8 filename: src : filetype: Warning: filetype(): Lstat failed for ./usrlib64 in /in/942Mj on line 8 filename: lib64 : filetype: Warning: filetype(): Lstat failed for ./usrsbin in /in/942Mj on line 8 filename: sbin : filetype:
Output for 5.5.24 - 5.5.32, 5.5.34 - 5.6.17, 5.6.20 - 5.6.21, 7.0.0 - 7.0.3, 7.0.5 - 7.0.6
Warning: filetype(): Lstat failed for ./usr. in /in/942Mj on line 8 filename: . : filetype: Warning: filetype(): Lstat failed for ./usr.. in /in/942Mj on line 8 filename: .. : filetype: Warning: filetype(): Lstat failed for ./usrlib64 in /in/942Mj on line 8 filename: lib64 : filetype: Warning: filetype(): Lstat failed for ./usrsbin in /in/942Mj on line 8 filename: sbin : filetype: Warning: filetype(): Lstat failed for ./usrbin in /in/942Mj on line 8 filename: bin : filetype: Warning: filetype(): Lstat failed for ./usrinclude in /in/942Mj on line 8 filename: include : filetype: Warning: filetype(): Lstat failed for ./usrlib in /in/942Mj on line 8 filename: lib : filetype: Warning: filetype(): Lstat failed for ./usrlocal in /in/942Mj on line 8 filename: local : filetype: Warning: filetype(): Lstat failed for ./usrshare in /in/942Mj on line 8 filename: share : filetype: Warning: filetype(): Lstat failed for ./usrsrc in /in/942Mj on line 8 filename: src : filetype:
Output for 5.2.3 - 5.4.45, 5.5.33, 5.6.18 - 5.6.19, 7.0.4
Warning: opendir(./usr): failed to open dir: Permission denied in /in/942Mj on line 6
Output for hhvm-3.12.0
Warning: Permission denied in /in/942Mj on line 6
Output for hhvm-3.10.0

Process exited with code 153.
Output for 4.3.0 - 5.2.2