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 = '.'; 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.0090.01317.25
8.3.50.0170.00318.20
8.3.40.0070.00719.23
8.3.30.0100.00319.35
8.3.20.0060.00320.37
8.3.10.0040.00422.11
8.3.00.0000.00819.39
8.2.180.0100.00618.79
8.2.170.0150.00018.99
8.2.160.0130.00322.96
8.2.150.0060.00324.18
8.2.140.0050.00524.66
8.2.130.0080.00026.16
8.2.120.0040.00419.79
8.2.110.0030.00620.40
8.2.100.0100.00318.03
8.2.90.0040.00419.23
8.2.80.0030.00717.97
8.2.70.0060.00317.49
8.2.60.0000.00817.91
8.2.50.0060.00318.07
8.2.40.0000.00818.34
8.2.30.0000.00819.61
8.2.20.0050.00317.91
8.2.10.0050.00318.24
8.2.00.0000.00717.79
8.1.270.0030.00619.12
8.1.260.0110.00026.35
8.1.250.0060.00628.09
8.1.240.0030.00623.91
8.1.230.0110.00419.16
8.1.220.0000.00817.77
8.1.210.0000.00818.77
8.1.200.0070.00317.47
8.1.190.0000.00817.23
8.1.180.0040.00418.10
8.1.170.0060.00318.70
8.1.160.0040.00422.01
8.1.150.0040.00419.00
8.1.140.0000.00817.55
8.1.130.0000.00717.94
8.1.120.0040.00417.48
8.1.110.0000.00817.62
8.1.100.0000.00717.50
8.1.90.0000.00717.64
8.1.80.0040.00417.59
8.1.70.0040.00417.59
8.1.60.0030.00717.76
8.1.50.0030.00517.67
8.1.40.0030.00617.76
8.1.30.0090.00017.75
8.1.20.0060.00317.76
8.1.10.0000.00817.66
8.1.00.0050.00317.66
8.0.300.0040.00418.77
8.0.290.0000.00716.88
8.0.280.0040.00418.55
8.0.270.0070.00017.29
8.0.260.0000.00717.27
8.0.250.0000.00817.16
8.0.240.0000.00717.14
8.0.230.0020.00517.24
8.0.220.0030.00317.09
8.0.210.0040.00417.13
8.0.200.0030.00317.09
8.0.190.0050.00317.17
8.0.180.0000.00717.13
8.0.170.0030.00517.09
8.0.160.0040.00417.08
8.0.150.0000.00717.06
8.0.140.0040.00417.13
8.0.130.0000.00613.72
8.0.120.0070.00415.39
8.0.110.0020.00715.40
8.0.100.0050.00615.38
8.0.90.0070.00315.41
8.0.80.0100.00715.45
8.0.70.0070.00415.51
8.0.60.0100.00015.35
8.0.50.0030.00715.36
8.0.30.0060.01316.20
8.0.20.0110.00616.16
8.0.10.0070.00315.45
8.0.00.0070.00715.89
7.4.330.0070.00015.03
7.4.320.0040.00416.69
7.4.300.0030.00316.60
7.4.290.0000.00816.65
7.4.280.0000.00816.68
7.4.270.0030.00316.70
7.4.260.0000.00716.50
7.4.250.0070.00415.27
7.4.240.0080.00215.75
7.4.230.0060.00415.19
7.4.220.0130.00615.20
7.4.210.0070.00815.72
7.4.200.0070.00315.00
7.4.190.0130.00013.70
7.4.180.0040.00813.70
7.4.160.0100.00415.12
7.4.150.0050.01115.52
7.4.140.0100.00916.38
7.4.130.0120.00515.62
7.4.120.0090.00615.61
7.4.110.0130.00615.23
7.4.100.0100.00915.15
7.4.90.0120.00315.01
7.4.80.0120.00416.41
7.4.70.0100.00515.13
7.4.60.0130.00315.12
7.4.50.0030.00515.11
7.4.40.0070.00615.06
7.4.30.0090.00815.31
7.4.20.0120.00013.41
7.4.10.0050.00413.34
7.4.00.0070.00814.89
7.3.330.0050.00013.50
7.3.320.0060.00013.34
7.3.310.0030.00514.98
7.3.300.0020.00614.97
7.3.290.0040.00414.96
7.3.280.0060.00815.73
7.3.270.0100.00515.40
7.3.260.0090.00314.95
7.3.250.0050.01215.50
7.3.240.0060.00614.96
7.3.230.0070.00814.81
7.3.220.0020.00813.26
7.3.210.0070.00915.05
7.3.200.0060.00716.13
7.3.190.0080.00614.76
7.3.180.0080.00415.05
7.3.170.0070.00714.88
7.3.160.0100.00514.85
7.3.150.0000.00813.15
7.3.140.0050.00313.34
7.3.130.0090.00013.06
7.3.120.0080.00814.40
7.3.110.0080.00714.50
7.3.100.0030.00814.50
7.3.90.0060.00414.49
7.3.80.0080.00314.52
7.3.70.0070.00514.38
7.3.60.0100.00214.46
7.3.50.0060.00514.48
7.3.40.0050.00914.49
7.3.30.0030.00814.39
7.3.20.0070.00416.36
7.3.10.0050.00816.37
7.3.00.0080.00516.27
7.2.340.0080.00413.39
7.2.330.0100.00515.26
7.2.320.0090.00615.11
7.2.310.0080.00614.96
7.2.300.0070.00715.12
7.2.290.0140.00315.14
7.2.280.0040.00813.39
7.2.270.0130.00013.57
7.2.260.0080.00413.58
7.2.250.0060.01214.84
7.2.240.0090.01014.84
7.2.230.0030.01314.72
7.2.220.0060.01014.76
7.2.210.0090.00414.70
7.2.200.0050.01114.65
7.2.190.0090.00614.83
7.2.180.0030.01014.75
7.2.170.0040.01014.68
7.2.160.0090.00313.57
7.2.150.0130.00015.35
7.2.140.0060.00615.50
7.2.130.0090.00415.59
7.2.120.0130.00015.38
7.2.110.0130.00015.39
7.2.100.0060.00615.61
7.2.90.0100.00315.52
7.2.80.0100.00315.60
7.2.70.0100.00315.54
7.2.60.0070.00716.31
7.2.50.0110.00315.54
7.2.40.0090.00415.38
7.2.30.0100.00315.38
7.2.20.0130.00015.45
7.2.10.0080.00515.63
7.2.00.0050.00917.54
7.1.330.0070.00715.54
7.1.320.0040.01015.47
7.1.310.0050.00815.53
7.1.300.0060.00615.49
7.1.290.0060.00815.39
7.1.280.0090.00415.43
7.1.270.0030.01015.47
7.1.260.0050.00715.55
7.1.250.0040.00814.38
7.1.240.0080.00414.44
7.1.230.0080.00414.36
7.1.220.0100.00214.33
7.1.210.0080.00414.52
7.1.200.0070.00415.23
7.1.190.0040.00814.46
7.1.180.0120.00014.29
7.1.170.0060.00614.24
7.1.160.0060.00614.29
7.1.150.0090.00314.25
7.1.140.0120.00014.27
7.1.130.0090.00414.41
7.1.120.0060.00614.41
7.1.110.0120.00014.50
7.1.100.0060.00516.27
7.1.90.0080.00414.45
7.1.80.0120.00014.55
7.1.70.0050.00715.77
7.1.60.0080.00917.02
7.1.50.0110.00515.84
7.1.40.0110.00014.50
7.1.30.0120.00014.34
7.1.20.0040.00814.34
7.1.10.0120.00014.46
7.1.00.0110.03518.41
7.0.330.0120.00014.41
7.0.320.0040.00814.21
7.0.310.0070.00514.38
7.0.300.0060.00614.41
7.0.290.0080.00414.45
7.0.280.0080.00314.43
7.0.270.0080.00314.41
7.0.260.0080.00414.35
7.0.250.0130.00014.55
7.0.240.0060.00614.54
7.0.230.0060.00614.30
7.0.220.0070.00714.41
7.0.210.0080.00414.46
7.0.200.0240.00314.58
7.0.190.0120.00014.42
7.0.180.0090.00314.46
7.0.170.0080.00414.35
7.0.160.0060.00614.26
7.0.150.0060.00614.38
7.0.140.0080.01818.17
7.0.130.0090.00314.49
7.0.120.0000.01214.32
7.0.110.0120.00014.21
7.0.100.0060.00614.23
7.0.90.0120.00014.26
7.0.80.0100.00214.17
7.0.70.0120.00014.32
7.0.60.0140.03717.17
7.0.50.0050.03916.08
7.0.40.0110.04217.41
7.0.30.0200.04217.29
7.0.20.0150.04317.30
7.0.10.0090.03617.25
7.0.00.0000.03617.30
5.6.400.0070.00512.95
5.6.390.0090.00212.99
5.6.380.0120.00012.77
5.6.370.0060.00612.91
5.6.360.0060.00613.00
5.6.350.0040.00812.88
5.6.340.0120.00012.84
5.6.330.0060.00612.75
5.6.320.0060.00612.84
5.6.310.0100.00212.84
5.6.300.0070.00412.79
5.6.290.0120.00012.92
5.6.280.0060.04017.16
5.6.270.0110.00012.90
5.6.260.0080.00412.70
5.6.250.0060.00613.02
5.6.240.0080.00413.01
5.6.230.0090.00312.89
5.6.220.0080.00413.13
5.6.210.0070.02216.79
5.6.200.0060.04315.70
5.6.190.0040.03016.85
5.6.180.0320.02916.79
5.6.170.0180.02516.92
5.6.160.0070.04016.94
5.6.150.0090.02015.64
5.6.140.0050.02215.67
5.6.130.0090.03215.57
5.6.120.0040.04817.16
5.6.110.0090.04317.05
5.6.100.0120.03917.08
5.6.90.0080.04117.03
5.6.80.0050.04416.62
5.6.70.0110.00013.27
5.6.60.0080.00513.10
5.6.50.0040.00912.66
5.6.40.0040.00713.14
5.6.30.0080.00413.13
5.6.20.0070.00412.92
5.6.10.0070.00312.71
5.6.00.0040.00812.77
5.5.380.0120.00013.04
5.5.370.0060.00613.04
5.5.360.0090.00212.77
5.5.350.0040.02516.67
5.5.340.0080.04215.55
5.5.330.0090.04016.73
5.5.320.0890.03416.74
5.5.310.0120.03216.65
5.5.300.0040.02415.53
5.5.290.0070.02815.48
5.5.280.0140.03816.96
5.5.270.0160.03516.98
5.5.260.0080.02116.78
5.5.250.0100.04116.76
5.5.240.0060.02316.71
5.5.230.0060.00612.97
5.5.220.0080.00413.07
5.5.210.0080.00312.86
5.5.200.0090.00312.71
5.5.190.0040.00712.73
5.5.180.0090.00212.94
5.5.170.0050.00512.63
5.5.160.0110.00012.73
5.5.150.0060.00612.87
5.5.140.0070.00412.49
5.5.130.0060.00612.46
5.5.120.0060.00612.73
5.5.110.0090.00312.66
5.5.100.0080.00413.04
5.5.90.0090.00312.88
5.5.80.0030.00713.16
5.5.70.0120.00013.17
5.5.60.0070.00513.01
5.5.50.0090.00213.11
5.5.40.0070.00412.98
5.5.30.0070.00413.11
5.5.20.0040.00812.97
5.5.10.0100.00012.92
5.5.00.0070.00312.64
5.4.450.0290.02717.08
5.4.440.0240.02517.05
5.4.430.0270.02217.12
5.4.420.0270.02017.12
5.4.410.0410.02417.11
5.4.400.0310.02017.06
5.4.390.0300.02416.91
5.4.380.0350.02317.10
5.4.370.0340.02017.04
5.4.360.0420.02317.00
5.4.350.0240.02317.09
5.4.340.0530.01816.92
5.4.330.0060.00612.87
5.4.320.0470.01817.12
5.4.310.0350.02217.13
5.4.300.0420.02317.01
5.4.290.0390.01917.15
5.4.280.0480.02017.05
5.4.270.0490.01616.96
5.4.260.0430.02116.98
5.4.250.0420.02017.15
5.4.240.0280.02317.18
5.4.230.0490.02117.01
5.4.220.0450.02217.01
5.4.210.0580.01916.93
5.4.200.0330.01816.93
5.4.190.0390.01717.06
5.4.180.0390.01716.99
5.4.170.0460.02117.11
5.4.160.0340.01917.11
5.4.150.0390.01817.15
5.4.140.0300.02417.13
5.4.130.0180.02317.19
5.4.120.0470.02017.16
5.4.110.0260.01917.14
5.4.100.0240.02017.16
5.4.90.0300.02017.06
5.4.80.0470.01517.14
5.4.70.0360.02217.10
5.4.60.0120.03217.14
5.4.50.0550.02217.20
5.4.40.0400.01317.11
5.4.30.0670.01517.24
5.4.20.0420.02217.15
5.4.10.0220.02017.19
5.4.00.0360.01816.93
5.3.290.0290.01916.96
5.3.280.0430.02016.92
5.3.270.0390.02416.99
5.3.260.0330.02417.13
5.3.250.0450.02916.99
5.3.240.0270.02717.05
5.3.230.0420.02117.07
5.3.220.0450.02016.96
5.3.210.0370.02317.02
5.3.200.0230.02317.09
5.3.190.0400.01917.09
5.3.180.0280.02717.11
5.3.170.0380.02317.16
5.3.160.0250.02217.16
5.3.150.0120.02017.04
5.3.140.0480.02417.08
5.3.130.0300.02517.02
5.3.120.0160.02317.14
5.3.110.0340.02217.04
5.3.100.0270.02417.02
5.3.90.0390.01817.04
5.3.80.0590.01717.05
5.3.70.0290.01816.97
5.3.60.0410.01817.07
5.3.50.0320.02017.04
5.3.40.0270.02017.08
5.3.30.0470.01817.07
5.3.20.0300.02016.95
5.3.10.0560.01616.87
5.3.00.0380.02216.97
5.2.170.0290.01616.58
5.2.160.0390.01316.54
5.2.150.0400.01416.63
5.2.140.0140.01716.47
5.2.130.0390.01316.48
5.2.120.0180.01616.49
5.2.110.0300.01616.47
5.2.100.0110.01716.60
5.2.90.0240.01316.62
5.2.80.0360.01216.45
5.2.70.0500.01016.57
5.2.60.0400.02016.38
5.2.50.0270.02516.51
5.2.40.0230.01916.46
5.2.30.0260.01916.56
5.2.20.0260.01616.38
5.2.10.0330.01816.41
5.2.00.0110.01916.42
5.1.60.0330.01516.14
5.1.50.0220.01416.01
5.1.40.0270.01516.07
5.1.30.0320.01016.19
5.1.20.0160.01816.15
5.1.10.0120.01216.16
5.1.00.0130.01716.04
5.0.50.0080.01815.72
5.0.40.0200.01215.70
5.0.30.0180.01815.70
5.0.20.0170.00815.70
5.0.10.0170.00815.70
5.0.00.0070.01815.70
4.4.90.0200.01015.70
4.4.80.0150.00715.70
4.4.70.0150.00815.70
4.4.60.0230.00715.70
4.4.50.0120.01215.70
4.4.40.0090.01215.70
4.4.30.0090.00615.70
4.4.20.0170.00315.70
4.4.10.0100.01515.70
4.4.00.0130.01015.70
4.3.110.0170.01215.70
4.3.100.0080.00815.70
4.3.90.0130.00915.70
4.3.80.0140.01315.70
4.3.70.0080.01215.70
4.3.60.0090.00515.70
4.3.50.0130.01215.70
4.3.40.0020.01515.70
4.3.30.0020.00815.70
4.3.20.0020.01015.70
4.3.10.0020.01015.70
4.3.00.0030.00815.70

preferences:
57.16 ms | 400 KiB | 5 Q