3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $d = dir("/etc"); echo "Handle: " . $d->handle . "\n"; echo "Path: " . $d->path . "\n"; while (false !== ($entry = $d->read())) { echo $entry."\n"; } $d->close();
Output for 5.6.28, 7.0.14 - 7.1.0
Handle: Resource id #5 Path: /etc . .. ImageMagick-6 ODBCDataSources ca-certificates default fonts hhvm ld.so.conf.d openldap pacman.d pam.d pkcs11 profile.d request-key.d security skel ssl arch-release crypttab fstab group gshadow host.conf hosts issue ld.so.conf motd netconfig nsswitch.conf passwd profile request-key.conf resolv.conf securetty shadow shells rpc nscd.conf gai.conf locale.gen mke2fs.conf krb5.conf environment machine-id php_archive.ini php.ini mtab localtime bash.bash_logout bash.bashrc inputrc ld.so.cache login.defs odbc.ini odbcinst.ini protocols services
Output for 7.0.12
Handle: Resource id #5 Path: /etc . .. ImageMagick-6 ODBCDataSources ca-certificates default fonts hhvm ld.so.conf.d openldap pacman.d pam.d pkcs11 profile.d request-key.d security skel ssl arch-release crypttab fstab group gshadow host.conf hosts issue ld.so.conf login.defs motd netconfig nsswitch.conf odbc.ini odbcinst.ini passwd profile request-key.conf resolv.conf securetty shadow shells services protocols rpc nscd.conf gai.conf locale.gen inputrc bash.bashrc bash.bash_logout mke2fs.conf krb5.conf environment ld.so.cache machine-id php_archive.ini php.ini mtab localtime
Output for 5.5.25 - 5.5.26, 5.6.8 - 5.6.10, 5.6.21, 7.0.6
Handle: Resource id #5 Path: /etc . .. mtab ImageMagick-6 ODBCDataSources ca-certificates default fonts hhvm ld.so.conf.d openldap pacman.d pam.d pkcs11 profile.d request-key.d security skel ssl inputrc krb5.conf login.defs odbc.ini odbcinst.ini request-key.conf mke2fs.conf arch-release crypttab fstab group gshadow host.conf hosts issue motd nsswitch.conf passwd profile resolv.conf securetty shadow shells netconfig bash.bash_logout bash.bashrc environment gai.conf ld.so.conf locale.gen nscd.conf rpc php.ini php_archive.ini protocols services ld.so.cache localtime
Output for 5.5.29 - 5.5.32, 5.5.34, 5.6.13 - 5.6.17, 5.6.20, 7.0.0 - 7.0.3, 7.0.5
Handle: Resource id #5 Path: /etc . .. mtab ImageMagick-6 ODBCDataSources ca-certificates default fonts hhvm ld.so.conf.d openldap pacman.d pam.d pkcs11 profile.d request-key.d security skel ssl inputrc krb5.conf login.defs odbc.ini odbcinst.ini php.ini request-key.conf mke2fs.conf arch-release crypttab fstab group gshadow host.conf hosts issue motd nsswitch.conf passwd profile resolv.conf securetty shadow shells protocols services netconfig bash.bash_logout bash.bashrc environment gai.conf ld.so.cache ld.so.conf locale.gen nscd.conf rpc localtime
Output for 7.0.4
Warning: dir(/etc): failed to open dir: Permission denied in /in/9h1JE on line 2 Notice: Trying to get property of non-object in /in/9h1JE on line 3 Handle: Notice: Trying to get property of non-object in /in/9h1JE on line 4 Path: Fatal error: Uncaught Error: Call to a member function read() on boolean in /in/9h1JE:5 Stack trace: #0 {main} thrown in /in/9h1JE on line 5
Process exited with code 255.
Output for 5.6.18 - 5.6.19
Warning: dir(/etc): failed to open dir: Permission denied in /in/9h1JE on line 2 Notice: Trying to get property of non-object in /in/9h1JE on line 3 Handle: Notice: Trying to get property of non-object in /in/9h1JE on line 4 Path: Fatal error: Call to a member function read() on boolean in /in/9h1JE on line 5
Process exited with code 255.
Output for 5.5.27 - 5.5.28, 5.6.11 - 5.6.12
Handle: Resource id #5 Path: /etc . .. mtab ImageMagick-6 ODBCDataSources ca-certificates default fonts hhvm ld.so.conf.d openldap pacman.d pam.d pkcs11 profile.d request-key.d security skel ssl inputrc krb5.conf login.defs odbc.ini odbcinst.ini request-key.conf mke2fs.conf arch-release crypttab fstab group gshadow host.conf hosts issue motd nsswitch.conf passwd profile resolv.conf securetty shadow shells netconfig bash.bash_logout bash.bashrc environment gai.conf ld.so.conf locale.gen nscd.conf rpc ld.so.cache php.ini php_archive.ini protocols services localtime
Output for 5.5.24, 5.5.35 - 5.6.7
Handle: Resource id #5 Path: /etc . .. mtab ImageMagick-6 ODBCDataSources ca-certificates default fonts hhvm ld.so.conf.d openldap pacman.d pam.d pkcs11 profile.d request-key.d security skel ssl arch-release bash.bash_logout bash.bashrc crypttab environment fstab gai.conf group gshadow host.conf hosts inputrc issue krb5.conf ld.so.cache ld.so.conf locale.gen login.defs mke2fs.conf motd netconfig nscd.conf nsswitch.conf odbc.ini odbcinst.ini passwd php.ini php_archive.ini profile protocols request-key.conf resolv.conf rpc securetty services shadow shells localtime
Output for 5.0.0 - 5.4.45, 5.5.33
Warning: dir(/etc): failed to open dir: Permission denied in /in/9h1JE on line 2 Notice: Trying to get property of non-object in /in/9h1JE on line 3 Handle: Notice: Trying to get property of non-object in /in/9h1JE on line 4 Path: Fatal error: Call to a member function read() on a non-object in /in/9h1JE on line 5
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Warning: dir(/etc): failed to open dir: Permission denied in /in/9h1JE on line 2 Handle: Path: Fatal error: Call to a member function on a non-object in /in/9h1JE on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: dir(/etc) [http://www.php.net/function.dir]: failed to open dir: Permission denied in /in/9h1JE on line 2 Handle: Path: Fatal error: Call to a member function on a non-object in /in/9h1JE on line 5