3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php var_dump(scandir('/etc'));
Output for 5.6.28, 7.0.14 - 7.1.0
array(58) { [0]=> string(1) "." [1]=> string(2) ".." [2]=> string(13) "ImageMagick-6" [3]=> string(15) "ODBCDataSources" [4]=> string(12) "arch-release" [5]=> string(16) "bash.bash_logout" [6]=> string(11) "bash.bashrc" [7]=> string(15) "ca-certificates" [8]=> string(8) "crypttab" [9]=> string(7) "default" [10]=> string(11) "environment" [11]=> string(5) "fonts" [12]=> string(5) "fstab" [13]=> string(8) "gai.conf" [14]=> string(5) "group" [15]=> string(7) "gshadow" [16]=> string(4) "hhvm" [17]=> string(9) "host.conf" [18]=> string(5) "hosts" [19]=> string(7) "inputrc" [20]=> string(5) "issue" [21]=> string(9) "krb5.conf" [22]=> string(11) "ld.so.cache" [23]=> string(10) "ld.so.conf" [24]=> string(12) "ld.so.conf.d" [25]=> string(10) "locale.gen" [26]=> string(9) "localtime" [27]=> string(10) "login.defs" [28]=> string(10) "machine-id" [29]=> string(11) "mke2fs.conf" [30]=> string(4) "motd" [31]=> string(4) "mtab" [32]=> string(9) "netconfig" [33]=> string(9) "nscd.conf" [34]=> string(13) "nsswitch.conf" [35]=> string(8) "odbc.ini" [36]=> string(12) "odbcinst.ini" [37]=> string(8) "openldap" [38]=> string(8) "pacman.d" [39]=> string(5) "pam.d" [40]=> string(6) "passwd" [41]=> string(7) "php.ini" [42]=> string(15) "php_archive.ini" [43]=> string(6) "pkcs11" [44]=> string(7) "profile" [45]=> string(9) "profile.d" [46]=> string(9) "protocols" [47]=> string(16) "request-key.conf" [48]=> string(13) "request-key.d" [49]=> string(11) "resolv.conf" [50]=> string(3) "rpc" [51]=> string(9) "securetty" [52]=> string(8) "security" [53]=> string(8) "services" [54]=> string(6) "shadow" [55]=> string(6) "shells" [56]=> string(4) "skel" [57]=> string(3) "ssl" }
Output for 5.5.24 - 5.5.28, 5.5.35 - 5.6.12, 5.6.21, 7.0.6
array(57) { [0]=> string(1) "." [1]=> string(2) ".." [2]=> string(13) "ImageMagick-6" [3]=> string(15) "ODBCDataSources" [4]=> string(12) "arch-release" [5]=> string(16) "bash.bash_logout" [6]=> string(11) "bash.bashrc" [7]=> string(15) "ca-certificates" [8]=> string(8) "crypttab" [9]=> string(7) "default" [10]=> string(11) "environment" [11]=> string(5) "fonts" [12]=> string(5) "fstab" [13]=> string(8) "gai.conf" [14]=> string(5) "group" [15]=> string(7) "gshadow" [16]=> string(4) "hhvm" [17]=> string(9) "host.conf" [18]=> string(5) "hosts" [19]=> string(7) "inputrc" [20]=> string(5) "issue" [21]=> string(9) "krb5.conf" [22]=> string(11) "ld.so.cache" [23]=> string(10) "ld.so.conf" [24]=> string(12) "ld.so.conf.d" [25]=> string(10) "locale.gen" [26]=> string(9) "localtime" [27]=> string(10) "login.defs" [28]=> string(11) "mke2fs.conf" [29]=> string(4) "motd" [30]=> string(4) "mtab" [31]=> string(9) "netconfig" [32]=> string(9) "nscd.conf" [33]=> string(13) "nsswitch.conf" [34]=> string(8) "odbc.ini" [35]=> string(12) "odbcinst.ini" [36]=> string(8) "openldap" [37]=> string(8) "pacman.d" [38]=> string(5) "pam.d" [39]=> string(6) "passwd" [40]=> string(7) "php.ini" [41]=> string(15) "php_archive.ini" [42]=> string(6) "pkcs11" [43]=> string(7) "profile" [44]=> string(9) "profile.d" [45]=> string(9) "protocols" [46]=> string(16) "request-key.conf" [47]=> string(13) "request-key.d" [48]=> string(11) "resolv.conf" [49]=> string(3) "rpc" [50]=> string(9) "securetty" [51]=> string(8) "security" [52]=> string(8) "services" [53]=> string(6) "shadow" [54]=> string(6) "shells" [55]=> string(4) "skel" [56]=> string(3) "ssl" }
Output for 5.5.29 - 5.5.32, 5.5.34, 5.6.13 - 5.6.17, 5.6.20, hhvm-3.10.0, 7.0.0 - 7.0.3, 7.0.5
array(56) { [0]=> string(1) "." [1]=> string(2) ".." [2]=> string(13) "ImageMagick-6" [3]=> string(15) "ODBCDataSources" [4]=> string(12) "arch-release" [5]=> string(16) "bash.bash_logout" [6]=> string(11) "bash.bashrc" [7]=> string(15) "ca-certificates" [8]=> string(8) "crypttab" [9]=> string(7) "default" [10]=> string(11) "environment" [11]=> string(5) "fonts" [12]=> string(5) "fstab" [13]=> string(8) "gai.conf" [14]=> string(5) "group" [15]=> string(7) "gshadow" [16]=> string(4) "hhvm" [17]=> string(9) "host.conf" [18]=> string(5) "hosts" [19]=> string(7) "inputrc" [20]=> string(5) "issue" [21]=> string(9) "krb5.conf" [22]=> string(11) "ld.so.cache" [23]=> string(10) "ld.so.conf" [24]=> string(12) "ld.so.conf.d" [25]=> string(10) "locale.gen" [26]=> string(9) "localtime" [27]=> string(10) "login.defs" [28]=> string(11) "mke2fs.conf" [29]=> string(4) "motd" [30]=> string(4) "mtab" [31]=> string(9) "netconfig" [32]=> string(9) "nscd.conf" [33]=> string(13) "nsswitch.conf" [34]=> string(8) "odbc.ini" [35]=> string(12) "odbcinst.ini" [36]=> string(8) "openldap" [37]=> string(8) "pacman.d" [38]=> string(5) "pam.d" [39]=> string(6) "passwd" [40]=> string(7) "php.ini" [41]=> string(6) "pkcs11" [42]=> string(7) "profile" [43]=> string(9) "profile.d" [44]=> string(9) "protocols" [45]=> string(16) "request-key.conf" [46]=> string(13) "request-key.d" [47]=> string(11) "resolv.conf" [48]=> string(3) "rpc" [49]=> string(9) "securetty" [50]=> string(8) "security" [51]=> string(8) "services" [52]=> string(6) "shadow" [53]=> string(6) "shells" [54]=> string(4) "skel" [55]=> string(3) "ssl" }
Output for 5.0.0 - 5.4.45, 5.5.33, 5.6.18 - 5.6.19, 7.0.4
Warning: scandir(/etc): failed to open dir: Permission denied in /in/dGMlA on line 1 Warning: scandir(): (errno 13): Permission denied in /in/dGMlA on line 1 bool(false)
Output for hhvm-3.12.0
Warning: Permission denied in /in/dGMlA on line 1 bool(false)
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: scandir() in /in/dGMlA on line 1
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: scandir() in /in/dGMlA on line 1
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: scandir() in /in/dGMlA on line 1