3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(scandir('glob:///etc/*'));
Output for 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
array(25) { [0]=> string(12) "arch-release" [1]=> string(8) "crypttab" [2]=> string(5) "fstab" [3]=> string(5) "group" [4]=> string(7) "gshadow" [5]=> string(9) "host.conf" [6]=> string(5) "hosts" [7]=> string(5) "issue" [8]=> string(10) "ld.so.conf" [9]=> string(12) "ld.so.conf.d" [10]=> string(4) "motd" [11]=> string(13) "nsswitch.conf" [12]=> string(8) "pacman.d" [13]=> string(6) "passwd" [14]=> string(7) "php.ini" [15]=> string(15) "php_archive.ini" [16]=> string(7) "profile" [17]=> string(9) "profile.d" [18]=> string(9) "protocols" [19]=> string(11) "resolv.conf" [20]=> string(9) "securetty" [21]=> string(8) "services" [22]=> string(6) "shadow" [23]=> string(6) "shells" [24]=> string(4) "skel" }
Output for 7.4.27 - 7.4.33, 8.0.14 - 8.0.30, 8.1.0 - 8.1.27
array(26) { [0]=> string(12) "arch-release" [1]=> string(8) "crypttab" [2]=> string(5) "fstab" [3]=> string(5) "group" [4]=> string(7) "gshadow" [5]=> string(9) "host.conf" [6]=> string(5) "hosts" [7]=> string(5) "issue" [8]=> string(10) "ld.so.conf" [9]=> string(12) "ld.so.conf.d" [10]=> string(4) "motd" [11]=> string(4) "mtab" [12]=> string(13) "nsswitch.conf" [13]=> string(8) "pacman.d" [14]=> string(6) "passwd" [15]=> string(7) "php.ini" [16]=> string(15) "php_archive.ini" [17]=> string(7) "profile" [18]=> string(9) "profile.d" [19]=> string(9) "protocols" [20]=> string(11) "resolv.conf" [21]=> string(9) "securetty" [22]=> string(8) "services" [23]=> string(6) "shadow" [24]=> string(6) "shells" [25]=> string(4) "skel" }
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.34, 7.3.0 - 7.3.33, 7.4.0 - 7.4.26, 8.0.0 - 8.0.13
array(24) { [0]=> string(12) "arch-release" [1]=> string(8) "crypttab" [2]=> string(5) "fstab" [3]=> string(5) "group" [4]=> string(7) "gshadow" [5]=> string(9) "host.conf" [6]=> string(5) "hosts" [7]=> string(5) "issue" [8]=> string(10) "ld.so.conf" [9]=> string(12) "ld.so.conf.d" [10]=> string(4) "motd" [11]=> string(4) "mtab" [12]=> string(13) "nsswitch.conf" [13]=> string(8) "pacman.d" [14]=> string(6) "passwd" [15]=> string(7) "profile" [16]=> string(9) "profile.d" [17]=> string(9) "protocols" [18]=> string(11) "resolv.conf" [19]=> string(9) "securetty" [20]=> string(8) "services" [21]=> string(6) "shadow" [22]=> string(6) "shells" [23]=> string(4) "skel" }
Output for 5.2.3 - 5.2.17
Warning: scandir(glob:///etc/*): failed to open dir: No such file or directory in /in/69UQM on line 1 Warning: scandir(): (errno 2): No such file or directory in /in/69UQM on line 1 bool(false)
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.2
<br /> <b>Warning</b>: scandir(glob:///etc/*) [<a href='function.scandir'>function.scandir</a>]: failed to open dir: No such file or directory in <b>/in/69UQM</b> on line <b>1</b><br /> <br /> <b>Warning</b>: scandir() [<a href='function.scandir'>function.scandir</a>]: (errno 2): No such file or directory in <b>/in/69UQM</b> on line <b>1</b><br /> bool(false)
Output for 4.4.5 - 4.4.9
<br /> <b>Fatal error</b>: Call to undefined function: scandir() in <b>/in/69UQM</b> on line <b>1</b><br />
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
<br /> <b>Fatal error</b>: Call to undefined function: scandir() in <b>/in/69UQM</b> on line <b>1</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.1
<br /> <b>Fatal error</b>: Call to undefined function: scandir() in <b>/in/69UQM</b> on line <b>1</b><br />

preferences:
330.63 ms | 401 KiB | 464 Q