3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $d = dir("/etc"); while (false !== ($entry = $d->read())) { echo $entry; } $d->close();
based on E7Wbg
Output for 5.6.28, 7.0.14 - 7.1.0
...ImageMagick-6ODBCDataSourcesca-certificatesdefaultfontshhvmld.so.conf.dopenldappacman.dpam.dpkcs11profile.drequest-key.dsecurityskelsslarch-releasecrypttabfstabgroupgshadowhost.confhostsissueld.so.confmotdnetconfignsswitch.confpasswdprofilerequest-key.confresolv.confsecurettyshadowshellsrpcnscd.confgai.conflocale.genmke2fs.confkrb5.confenvironmentmachine-idphp_archive.iniphp.inimtablocaltimebash.bash_logoutbash.bashrcinputrcld.so.cachelogin.defsodbc.iniodbcinst.iniprotocolsservices
Output for 5.5.25 - 5.5.26, 5.6.8 - 5.6.10, 5.6.21, 7.0.6
...mtabImageMagick-6ODBCDataSourcesca-certificatesdefaultfontshhvmld.so.conf.dopenldappacman.dpam.dpkcs11profile.drequest-key.dsecurityskelsslinputrckrb5.conflogin.defsodbc.iniodbcinst.inirequest-key.confmke2fs.confarch-releasecrypttabfstabgroupgshadowhost.confhostsissuemotdnsswitch.confpasswdprofileresolv.confsecurettyshadowshellsnetconfigbash.bash_logoutbash.bashrcenvironmentgai.confld.so.conflocale.gennscd.confrpcphp.iniphp_archive.iniprotocolsservicesld.so.cachelocaltime
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
...mtabImageMagick-6ODBCDataSourcesca-certificatesdefaultfontshhvmld.so.conf.dopenldappacman.dpam.dpkcs11profile.drequest-key.dsecurityskelsslinputrckrb5.conflogin.defsodbc.iniodbcinst.iniphp.inirequest-key.confmke2fs.confarch-releasecrypttabfstabgroupgshadowhost.confhostsissuemotdnsswitch.confpasswdprofileresolv.confsecurettyshadowshellsprotocolsservicesnetconfigbash.bash_logoutbash.bashrcenvironmentgai.confld.so.cacheld.so.conflocale.gennscd.confrpclocaltime
Output for 7.0.4
Warning: dir(/etc): failed to open dir: Permission denied in /in/Yln5Q on line 2 Fatal error: Uncaught Error: Call to a member function read() on boolean in /in/Yln5Q:4 Stack trace: #0 {main} thrown in /in/Yln5Q on line 4
Process exited with code 255.
Output for hhvm-3.12.0
Warning: Permission denied in /in/Yln5Q on line 2 Fatal error: Uncaught exception 'BadMethodCallException' with message 'Call to a member function read() on a non-object (boolean)' in /in/Yln5Q:4 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.6.18 - 5.6.19
Warning: dir(/etc): failed to open dir: Permission denied in /in/Yln5Q on line 2 Fatal error: Call to a member function read() on boolean in /in/Yln5Q on line 4
Process exited with code 255.
Output for 5.5.27 - 5.5.28, 5.6.11 - 5.6.12
...mtabImageMagick-6ODBCDataSourcesca-certificatesdefaultfontshhvmld.so.conf.dopenldappacman.dpam.dpkcs11profile.drequest-key.dsecurityskelsslinputrckrb5.conflogin.defsodbc.iniodbcinst.inirequest-key.confmke2fs.confarch-releasecrypttabfstabgroupgshadowhost.confhostsissuemotdnsswitch.confpasswdprofileresolv.confsecurettyshadowshellsnetconfigbash.bash_logoutbash.bashrcenvironmentgai.confld.so.conflocale.gennscd.confrpcld.so.cachephp.iniphp_archive.iniprotocolsserviceslocaltime
Output for 5.5.24, 5.5.35
...mtabImageMagick-6ODBCDataSourcesca-certificatesdefaultfontshhvmld.so.conf.dopenldappacman.dpam.dpkcs11profile.drequest-key.dsecurityskelsslarch-releasebash.bash_logoutbash.bashrccrypttabenvironmentfstabgai.confgroupgshadowhost.confhostsinputrcissuekrb5.confld.so.cacheld.so.conflocale.genlogin.defsmke2fs.confmotdnetconfignscd.confnsswitch.confodbc.iniodbcinst.inipasswdphp.iniphp_archive.iniprofileprotocolsrequest-key.confresolv.confrpcsecurettyservicesshadowshellslocaltime
Output for 5.0.0 - 5.4.45, 5.5.33
Warning: dir(/etc): failed to open dir: Permission denied in /in/Yln5Q on line 2 Fatal error: Call to a member function read() on a non-object in /in/Yln5Q on line 4
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Warning: dir(/etc): failed to open dir: Permission denied in /in/Yln5Q on line 2 Fatal error: Call to a member function on a non-object in /in/Yln5Q on line 4
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/Yln5Q on line 2 Fatal error: Call to a member function on a non-object in /in/Yln5Q on line 4