3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $d = dir(dirname(sys_get_temp_dir())."/etc"); while (false !== ($entry = $d->read())) { echo $entry."\n";} $file = fopen('/etc/os-release', 'r'); while($line = fgets($file)) { printf("%s\n", $line); }
Output for 7.2.0
Warning: dir(//etc): failed to open dir: Permission denied in /in/4e32G on line 2 Fatal error: Uncaught Error: Call to a member function read() on boolean in /in/4e32G:4 Stack trace: #0 {main} thrown in /in/4e32G on line 4
Process exited with code 255.
Output for 7.0.20, 7.1.5 - 7.1.7
. .. mtab hhvm ld.so.conf.d pacman.d profile.d skel arch-release bash.bash_logout bash.bashrc crypttab fstab gai.conf group gshadow host.conf hosts inputrc issue ld.so.cache ld.so.conf locale.gen machine-id motd nscd.conf nsswitch.conf passwd php.ini php_archive.ini profile protocols resolv.conf rpc securetty services shadow shells localtime Warning: fopen(/etc/os-release): failed to open stream: No such file or directory in /in/4e32G on line 6 Warning: fgets() expects parameter 1 to be resource, boolean given in /in/4e32G on line 8
Output for 7.0.14, 7.1.0
. .. 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 Warning: fopen(/etc/os-release): failed to open stream: No such file or directory in /in/4e32G on line 6 Warning: fgets() expects parameter 1 to be resource, boolean given in /in/4e32G on line 8
Output for 7.0.12
. .. 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 Warning: fopen(/etc/os-release): failed to open stream: No such file or directory in /in/4e32G on line 6 Warning: fgets() expects parameter 1 to be resource, boolean given in /in/4e32G on line 8
Output for 5.3.0 - 7.0.11
. .. 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 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.ini php_archive.ini localtime Warning: fopen(/etc/os-release): failed to open stream: No such file or directory in /in/4e32G on line 6 Warning: fgets() expects parameter 1 to be resource, boolean given in /in/4e32G on line 8
Output for 5.2.1 - 5.2.17
. .. 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 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.ini php_archive.ini localtime Warning: fopen(/etc/os-release): failed to open stream: No such file or directory in /in/4e32G on line 6 Warning: fgets(): supplied argument is not a valid stream resource in /in/4e32G on line 8
Output for 5.0.0 - 5.2.0
Fatal error: Call to undefined function sys_get_temp_dir() in /in/4e32G on line 2
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: sys_get_temp_dir() in /in/4e32G on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: sys_get_temp_dir() in /in/4e32G on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: sys_get_temp_dir() in /in/4e32G on line 2