3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dir = '/lib'; $files1 = scandir($dir); print_r($files1);
Output for 8.0.14 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Warning: scandir(): open_basedir restriction in effect. File(/lib) is not within the allowed path(s): (/tmp:/in:/etc) in /in/t9ap6 on line 3 Warning: scandir(/lib): Failed to open directory: Operation not permitted in /in/t9ap6 on line 3 Warning: scandir(): (errno 1): Operation not permitted in /in/t9ap6 on line 3
Output for 8.0.13
Warning: scandir(/lib): Failed to open directory: Permission denied in /in/t9ap6 on line 3 Warning: scandir(): (errno 13): Permission denied in /in/t9ap6 on line 3
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 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.31, 7.4.0 - 7.4.25, 8.0.0 - 8.0.12
Array ( [0] => . [1] => .. [2] => ld-linux-x86-64.so.2 [3] => libargon2.so.0 [4] => libargon2.so.1 [5] => libc.so.6 [6] => libcrypt.so.1 [7] => libdl.so.2 [8] => libgcc_s.so.1 [9] => libgmp.so.10 [10] => libicudata.so.52 [11] => libicudata.so.54 [12] => libicudata.so.55 [13] => libicudata.so.56 [14] => libicudata.so.57 [15] => libicudata.so.58 [16] => libicudata.so.59 [17] => libicudata.so.63 [18] => libicui18n.so.57 [19] => libicui18n.so.63 [20] => libicuio.so.57 [21] => libicuio.so.63 [22] => libicuuc.so.52 [23] => libicuuc.so.54 [24] => libicuuc.so.55 [25] => libicuuc.so.56 [26] => libicuuc.so.57 [27] => libicuuc.so.58 [28] => libicuuc.so.59 [29] => libicuuc.so.60 [30] => libicuuc.so.61 [31] => libicuuc.so.63 [32] => liblzma.so.5 [33] => libm.so.6 [34] => libnsl.so.1 [35] => libonig.so.4 [36] => libpthread.so.0 [37] => libresolv.so.2 [38] => librt.so.1 [39] => libsodium.so.18 [40] => libsqlite3.so.0 [41] => libstdc++.so.6 [42] => libutil.so.1 [43] => libxml2.so.2 [44] => libz.so.1 [45] => locale [46] => os-release [47] => php [48] => sysctl.d [49] => systemd [50] => sysusers.d [51] => tmpfiles.d )
Output for 7.3.32 - 7.3.33, 7.4.26, 7.4.33
Warning: scandir(/lib): failed to open dir: Permission denied in /in/t9ap6 on line 3 Warning: scandir(): (errno 13): Permission denied in /in/t9ap6 on line 3
Output for 7.4.27 - 7.4.32
Warning: scandir(): open_basedir restriction in effect. File(/lib) is not within the allowed path(s): (/tmp:/in:/etc) in /in/t9ap6 on line 3 Warning: scandir(/lib): failed to open dir: Operation not permitted in /in/t9ap6 on line 3 Warning: scandir(): (errno 1): Operation not permitted in /in/t9ap6 on line 3
Output for 4.4.5 - 4.4.9
<br /> <b>Fatal error</b>: Call to undefined function: scandir() in <b>/in/t9ap6</b> on line <b>3</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/t9ap6</b> on line <b>3</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/t9ap6</b> on line <b>3</b><br />

preferences:
299.07 ms | 401 KiB | 468 Q