3v4l.org

run code in 300+ PHP versions simultaneously
<?php function abc($file) { $perms = fileperms($file); if (($perms & 0xC000) == 0xC000) { // Socket $info = 's'; } elseif (($perms & 0xA000) == 0xA000) { // Symbolic Link $info = 'l'; } elseif (($perms & 0x8000) == 0x8000) { // Regular $info = '-'; } elseif (($perms & 0x6000) == 0x6000) { // Block special $info = 'b'; } elseif (($perms & 0x4000) == 0x4000) { // Directory $info = 'd'; } elseif (($perms & 0x2000) == 0x2000) { // Character special $info = 'c'; } elseif (($perms & 0x1000) == 0x1000) { // FIFO pipe $info = 'p'; } else { // Unknown $info = 'u'; } // Owner $info .= (($perms & 0x0100) ? 'r' : '-'); $info .= (($perms & 0x0080) ? 'w' : '-'); $info .= (($perms & 0x0040) ? (($perms & 0x0800) ? 's' : 'x' ) : (($perms & 0x0800) ? 'S' : '-')); // Group $info .= (($perms & 0x0020) ? 'r' : '-'); $info .= (($perms & 0x0010) ? 'w' : '-'); $info .= (($perms & 0x0008) ? (($perms & 0x0400) ? 's' : 'x' ) : (($perms & 0x0400) ? 'S' : '-')); // World $info .= (($perms & 0x0004) ? 'r' : '-'); $info .= (($perms & 0x0002) ? 'w' : '-'); $info .= (($perms & 0x0001) ? (($perms & 0x0200) ? 't' : 'x' ) : (($perms & 0x0200) ? 'T' : '-')); return posix_getpwuid(fileowner($file))['name'].' '.posix_getpwuid(filegroup($file))['name'].' '.$info; } echo posix_getpwuid(posix_geteuid())['name'].PHP_EOL.PHP_EOL; $d = '/usr'; foreach(scandir($d) as $dir) { //echo $dir.': '.substr(sprintf('%o', fileperms($dir)), -4).PHP_EOL; echo $dir.' '.abc($d.'/'.$dir).PHP_EOL; }

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.60.0140.00717.13
8.3.50.0100.01222.01
8.3.40.0120.00918.91
8.3.30.0080.00619.39
8.3.20.0040.00420.60
8.3.10.0040.00421.90
8.3.00.0000.00819.32
8.2.180.0100.00718.60
8.2.170.0070.00719.01
8.2.160.0080.00822.96
8.2.150.0040.00424.18
8.2.140.0070.00424.66
8.2.130.0000.00826.16
8.2.120.0040.00419.79
8.2.110.0000.00919.30
8.2.100.0040.00817.91
8.2.90.0000.00820.26
8.2.80.0040.00418.34
8.2.70.0040.00418.05
8.2.60.0080.00017.93
8.2.50.0030.00618.10
8.2.40.0080.00020.53
8.2.30.0000.00819.44
8.2.20.0050.00317.80
8.2.10.0050.00318.10
8.2.00.0000.00817.68
8.1.280.0110.01125.92
8.1.270.0040.00419.11
8.1.260.0090.00026.35
8.1.250.0040.00828.09
8.1.240.0090.00022.73
8.1.230.0090.00321.00
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0050.00317.60
8.1.190.0000.00817.23
8.1.180.0060.00318.10
8.1.170.0030.00818.59
8.1.160.0050.00222.25
8.1.150.0000.00719.01
8.1.140.0020.00517.49
8.1.130.0050.00317.82
8.1.120.0000.00717.68
8.1.110.0050.00317.54
8.1.100.0050.00317.58
8.1.90.0000.00717.75
8.1.80.0080.00017.59
8.1.70.0000.00817.61
8.1.60.0030.00617.72
8.1.50.0040.00417.69
8.1.40.0050.00217.53
8.1.30.0060.00317.78
8.1.20.0040.00417.67
8.1.10.0000.00817.61
8.1.00.0030.00617.65
8.0.300.0080.00020.20
8.0.290.0040.00416.88
8.0.280.0040.00418.47
8.0.270.0000.00717.40
8.0.260.0040.00417.37
8.0.250.0030.00517.22
8.0.240.0030.00317.26
8.0.230.0070.00017.16
8.0.220.0030.00316.95
8.0.210.0040.00417.13
8.0.200.0050.00217.17
8.0.190.0050.00317.23
8.0.180.0040.00417.11
8.0.170.0070.00017.04
8.0.160.0040.00417.09
8.0.150.0060.00317.05
8.0.140.0000.00717.06
8.0.130.0030.00313.77
8.0.120.0050.00615.39
8.0.110.0040.00615.40
8.0.100.0060.00415.38
8.0.90.0060.00415.37
8.0.80.0050.00915.46
8.0.70.0000.01115.47
8.0.60.0080.00315.35
8.0.50.0030.00715.43
8.0.30.0130.00516.13
8.0.20.0100.00716.26
8.0.10.0070.00415.47
8.0.00.0070.00716.11
7.4.330.0000.00815.03
7.4.320.0060.00016.66
7.4.300.0000.00716.67
7.4.290.0070.00016.70
7.4.280.0080.00016.63
7.4.270.0000.00716.79
7.4.260.0030.00516.82
7.4.250.0070.00515.15
7.4.240.0070.00215.70
7.4.230.0050.00715.19
7.4.220.0110.00615.22
7.4.210.0070.00815.68
7.4.200.0080.00215.15
7.4.190.0090.00313.59
7.4.180.0060.00613.63
7.4.160.0120.00615.09
7.4.150.0090.00615.51
7.4.140.0120.00416.43
7.4.130.0100.00915.65
7.4.120.0100.00615.61
7.4.110.0080.00915.09
7.4.100.0120.00515.24
7.4.90.0060.00815.18
7.4.80.0120.00316.49
7.4.70.0100.00515.10
7.4.60.0090.00615.06
7.4.50.0080.00315.13
7.4.40.0090.00614.94
7.4.30.0090.00715.08
7.4.20.0070.00213.45
7.4.10.0060.00213.14
7.4.00.0110.00414.78
7.3.330.0000.00713.46
7.3.320.0030.00313.48
7.3.310.0050.00414.87
7.3.300.0080.00015.04
7.3.290.0020.00714.80
7.3.280.0070.01015.70
7.3.270.0060.00815.39
7.3.260.0100.00314.94
7.3.250.0110.00615.55
7.3.240.0080.00515.03
7.3.230.0100.00314.85
7.3.220.0030.00713.22
7.3.210.0060.00714.97
7.3.200.0120.00416.19
7.3.190.0090.00614.83
7.3.180.0070.00915.01
7.3.170.0080.00615.04
7.3.160.0080.00414.87
7.3.150.0040.00413.35
7.3.140.0080.00013.33
7.3.130.0000.00813.06
7.3.120.0050.00814.15
7.3.110.0090.00514.12
7.3.100.0100.00414.13
7.3.90.0100.00314.31
7.3.80.0080.00414.30
7.3.70.0060.00314.16
7.3.60.0050.00714.20
7.3.50.0080.00514.26
7.3.40.0050.00614.18
7.3.30.0070.00714.07
7.3.20.0060.00616.08
7.3.10.0060.00415.96
7.3.00.0060.00515.96
7.2.340.0090.00313.39
7.2.330.0100.00815.17
7.2.320.0120.00715.09
7.2.310.0140.00715.09
7.2.300.0050.01015.09
7.2.290.0100.00715.23
7.2.280.0090.00513.49
7.2.270.0120.00013.36
7.2.260.0060.00713.59
7.2.250.0090.00714.37
7.2.240.0050.01114.50
7.2.230.0040.01114.53
7.2.220.0060.00814.30
7.2.210.0080.00414.38
7.2.200.0080.00414.41
7.2.190.0090.00514.45
7.2.180.0050.01114.45
7.2.170.0110.00414.49
7.2.160.0080.00413.72
7.2.150.0080.00515.49
7.2.140.0040.00815.52
7.2.130.0100.00315.61
7.2.120.0040.00815.36
7.2.110.0040.00815.60
7.2.100.0090.00215.51
7.2.90.0150.00015.58
7.2.80.0080.00615.57
7.2.70.0060.00615.43
7.2.60.0080.00716.31
7.2.50.0080.00515.47
7.2.40.0060.00615.58
7.2.30.0140.00015.57
7.2.20.0110.00315.58
7.2.10.0100.00315.61
7.2.00.0000.01217.39
7.1.330.0070.00515.38
7.1.320.0090.00515.34
7.1.310.0060.00715.18
7.1.300.0060.00715.23
7.1.290.0080.00615.28
7.1.280.0080.00815.19
7.1.270.0020.01315.15
7.1.260.0000.01215.21
7.1.250.0080.00414.30
7.1.240.0120.00014.48
7.1.230.0000.01214.54
7.1.220.0000.01214.31
7.1.210.0040.00914.33
7.1.200.0060.00715.23
7.1.190.0130.00014.40
7.1.180.0040.00814.50
7.1.170.0060.00614.43
7.1.160.0120.00014.49
7.1.150.0060.00614.26
7.1.140.0110.00214.41
7.1.130.0130.00014.48
7.1.120.0090.00314.49
7.1.110.0060.00614.49
7.1.100.0060.00716.19
7.1.90.0000.01214.32
7.1.80.0080.00414.50
7.1.70.0060.00415.77
7.1.60.0090.00417.03
7.1.50.0110.00715.94
7.1.40.0060.00614.41
7.1.30.0130.00014.52
7.1.20.0060.00714.52
7.1.10.0000.01314.49
7.1.00.0070.03918.48
7.0.330.0060.00614.39
7.0.320.0060.00614.46
7.0.310.0120.00014.36
7.0.300.0090.00314.47
7.0.290.0120.00014.21
7.0.280.0120.00014.23
7.0.270.0100.00214.27
7.0.260.0080.00414.38
7.0.250.0090.00514.50
7.0.240.0060.00614.53
7.0.230.0120.00014.49
7.0.220.0080.00414.42
7.0.210.0110.00014.46
7.0.200.0160.00514.63
7.0.190.0060.00614.48
7.0.180.0110.00014.28
7.0.170.0080.00414.38
7.0.160.0120.00014.33
7.0.150.0120.00014.23
7.0.140.0020.04118.33
7.0.130.0120.00014.30
7.0.120.0080.00414.29
7.0.110.0120.00014.18
7.0.100.0060.00614.22
7.0.90.0090.00314.30
7.0.80.0080.00414.11
7.0.70.0080.00514.29
7.0.60.0100.02817.24
7.0.50.0100.03816.12
7.0.40.0050.04517.39
7.0.30.0160.02517.31
7.0.20.0170.03517.35
7.0.10.0090.04517.33
7.0.00.0110.02517.38
5.6.400.0110.00012.71
5.6.390.0060.00612.65
5.6.380.0060.00612.77
5.6.370.0000.01212.91
5.6.360.0060.00612.88
5.6.350.0060.00612.85
5.6.340.0110.00013.01
5.6.330.0060.00613.07
5.6.320.0120.00012.92
5.6.310.0090.00312.74
5.6.300.0000.01212.79
5.6.290.0040.00813.08
5.6.280.0060.04016.99
5.6.270.0110.00012.89
5.6.260.0110.00012.90
5.6.250.0040.00712.93
5.6.240.0070.00513.13
5.6.230.0080.00313.27
5.6.220.0120.00013.20
5.6.210.0090.01916.89
5.6.200.0100.03915.79
5.6.190.0090.03316.74
5.6.180.0170.02916.96
5.6.170.0190.02616.97
5.6.160.0130.04016.76
5.6.150.0070.04215.75
5.6.140.0160.01615.71
5.6.130.0090.04215.76
5.6.120.0040.02417.00
5.6.110.0100.03217.06
5.6.100.0030.02617.04
5.6.90.0110.04316.95
5.6.80.0060.04516.71
5.6.70.0110.00013.19
5.6.60.0080.00313.08
5.6.50.0090.00312.81
5.6.40.0080.00313.02
5.6.30.0070.00412.88
5.6.20.0000.01112.87
5.6.10.0100.00012.99
5.6.00.0060.00612.92
5.5.380.0070.00412.78
5.5.370.0080.00313.20
5.5.360.0100.00212.95
5.5.350.0210.01816.63
5.5.340.0110.03015.49
5.5.330.0080.02016.65
5.5.320.0160.02316.53
5.5.310.0130.02016.65
5.5.300.0090.03815.55
5.5.290.0100.04215.42
5.5.280.0050.04716.99
5.5.270.0080.02816.93
5.5.260.0150.03817.02
5.5.250.0070.02216.97
5.5.240.0110.03816.54
5.5.230.0080.00313.05
5.5.220.0070.00513.12
5.5.210.0040.00713.04
5.5.200.0110.00012.73
5.5.190.0080.00412.77
5.5.180.0110.00012.63
5.5.170.0120.00012.64
5.5.160.0110.00012.94
5.5.150.0070.00412.57
5.5.140.0040.00712.65
5.5.130.0110.00012.65
5.5.120.0040.00812.65
5.5.110.0060.00612.73
5.5.100.0040.00713.01
5.5.90.0050.00512.83
5.5.80.0060.00612.88
5.5.70.0070.00412.94
5.5.60.0040.00712.87
5.5.50.0060.00612.98
5.5.40.0090.00313.11
5.5.30.0070.00412.87
5.5.20.0070.00413.02
5.5.10.0070.00413.02
5.5.00.0080.00412.98
5.4.450.0340.02217.41
5.4.440.0360.02317.38
5.4.430.0300.02517.38
5.4.420.0420.02317.28
5.4.410.0160.02417.39
5.4.400.0190.02817.35
5.4.390.0490.01817.40
5.4.380.0490.02017.28
5.4.370.0350.01517.33
5.4.360.0410.02617.22
5.4.350.0290.02117.33
5.4.340.0330.02217.43
5.4.330.0080.00313.03
5.4.320.0270.01817.38
5.4.310.0440.01917.38
5.4.300.0370.02317.31
5.4.290.0440.02017.34
5.4.280.0450.02717.43
5.4.270.0430.02717.29
5.4.260.0290.02917.39
5.4.250.0240.02117.34
5.4.240.0410.02517.33
5.4.230.0190.02517.13
5.4.220.0320.02717.15
5.4.210.0350.02317.23
5.4.200.0300.02117.26
5.4.190.0440.01717.28
5.4.180.0330.01917.25
5.4.170.0490.01617.23
5.4.160.0480.02117.20
5.4.150.0510.02217.27
5.4.140.0140.02517.29
5.4.130.0290.02217.38
5.4.120.0170.01817.36
5.4.110.0490.01817.38
5.4.100.0250.02517.32
5.4.90.0420.01917.29
5.4.80.0220.01717.47
5.4.70.0240.02417.36
5.4.60.0190.02617.55
5.4.50.0470.01517.38
5.4.40.0500.02217.37
5.4.30.0430.01617.48
5.4.20.0350.02017.40
5.4.10.0430.02317.37
5.4.00.0240.02217.38
5.3.290.0220.02617.37
5.3.280.0470.01717.33
5.3.270.0160.01717.37
5.3.260.0380.02417.26
5.3.250.0260.02817.36
5.3.240.0130.02217.27
5.3.230.0390.02017.20
5.3.220.0470.01817.32
5.3.210.0340.02317.26
5.3.200.0400.02317.31
5.3.190.0440.01817.36
5.3.180.0320.02217.29
5.3.170.0360.02217.30
5.3.160.0430.02417.32
5.3.150.0170.02517.30
5.3.140.0210.02017.35
5.3.130.0360.01817.40
5.3.120.0190.02017.39
5.3.110.0450.01817.39
5.3.100.0200.01817.26
5.3.90.0250.02017.31
5.3.80.0320.01817.25
5.3.70.0450.01917.36
5.3.60.0120.02717.25
5.3.50.0400.02217.22
5.3.40.0330.01717.19
5.3.30.0390.01817.22
5.3.20.0280.01917.21
5.3.10.0350.02517.22
5.3.00.0250.02417.12
5.2.170.0270.01916.76
5.2.160.0160.01716.80
5.2.150.0300.02416.78
5.2.140.0220.01416.73
5.2.130.0230.01716.76
5.2.120.0180.01316.84
5.2.110.0290.01716.80
5.2.100.0220.01816.86
5.2.90.0270.01616.74
5.2.80.0420.02016.83
5.2.70.0170.02116.81
5.2.60.0360.01616.73
5.2.50.0170.02116.70
5.2.40.0140.01916.78
5.2.30.0190.01716.79
5.2.20.0220.01916.62
5.2.10.0240.01316.70
5.2.00.0180.02016.54
5.1.60.0280.01316.21
5.1.50.0340.01416.24
5.1.40.0220.01516.26
5.1.30.0340.01216.42
5.1.20.0170.01716.30
5.1.10.0290.01516.28
5.1.00.0170.01216.27
5.0.50.0050.01316.02
5.0.40.0100.01315.95
5.0.30.0160.02015.95
5.0.20.0120.01215.95
5.0.10.0030.01315.95
5.0.00.0080.02015.95
4.4.90.0120.01015.95
4.4.80.0140.00915.95
4.4.70.0050.00815.95
4.4.60.0080.01015.95
4.4.50.0100.00815.95
4.4.40.0120.01215.95
4.4.30.0170.00715.95
4.4.20.0100.00715.95
4.4.10.0120.00715.95
4.4.00.0080.01415.95
4.3.110.0130.00915.95
4.3.100.0120.00815.95
4.3.90.0090.00815.95
4.3.80.0150.01515.95
4.3.70.0050.01215.95
4.3.60.0150.00815.95
4.3.50.0130.00915.95
4.3.40.0120.01515.95
4.3.30.0080.01015.92
4.3.20.0000.01015.92
4.3.10.0030.00815.92
4.3.00.0050.00715.92

preferences:
60.71 ms | 401 KiB | 5 Q