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 fileowner($file).' '.filegroup($file).' '.$info; } echo posix_getpwuid(posix_geteuid())['name'].PHP_EOL.PHP_EOL; foreach(scandir('.') as $dir) { //echo $dir.': '.substr(sprintf('%o', fileperms($dir)), -4).PHP_EOL; echo $dir.' '.abc('./'.$dir); }

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.70.0120.00418.93
8.3.60.0070.01417.00
8.3.50.0120.01022.10
8.3.40.0110.00419.10
8.3.30.0070.00719.34
8.3.20.0050.00320.48
8.3.10.0080.00022.02
8.3.00.0050.00519.33
8.2.180.0170.00316.75
8.2.170.0080.00822.96
8.2.160.0110.00422.21
8.2.150.0060.00324.18
8.2.140.0000.00924.66
8.2.130.0000.00826.16
8.2.120.0040.00419.41
8.2.110.0120.00022.50
8.2.100.0110.00018.16
8.2.90.0040.00419.48
8.2.80.0030.00617.97
8.2.70.0000.00817.63
8.2.60.0050.00317.93
8.2.50.0090.00318.07
8.2.40.0000.00918.16
8.2.30.0000.00719.53
8.2.20.0030.00517.73
8.2.10.0050.00318.27
8.2.00.0040.00417.89
8.1.280.0140.00725.92
8.1.270.0080.00019.12
8.1.260.0040.00426.35
8.1.250.0080.00428.09
8.1.240.0060.00324.06
8.1.230.0060.00621.04
8.1.220.0050.00317.89
8.1.210.0030.00618.77
8.1.200.0070.00217.48
8.1.190.0060.00317.48
8.1.180.0040.00418.10
8.1.170.0030.00618.74
8.1.160.0060.00322.04
8.1.150.0050.00218.89
8.1.140.0080.00017.58
8.1.130.0000.00717.86
8.1.120.0080.00017.57
8.1.110.0000.00817.61
8.1.100.0020.00517.57
8.1.90.0050.00317.57
8.1.80.0070.00017.55
8.1.70.0000.00717.61
8.1.60.0060.00317.66
8.1.50.0060.00317.68
8.1.40.0030.00517.73
8.1.30.0030.00517.58
8.1.20.0040.00417.69
8.1.10.0040.00417.66
8.1.00.0080.00017.64
8.0.300.0070.00018.77
8.0.290.0040.00416.75
8.0.280.0000.00718.48
8.0.270.0000.00717.25
8.0.260.0030.00317.28
8.0.250.0000.00717.18
8.0.240.0060.00317.14
8.0.230.0030.00317.13
8.0.220.0030.00317.02
8.0.210.0080.00017.12
8.0.200.0000.00717.13
8.0.190.0000.00716.99
8.0.180.0070.00017.11
8.0.170.0040.00417.09
8.0.160.0040.00417.12
8.0.150.0040.00417.07
8.0.140.0050.00217.05
8.0.130.0000.00613.73
8.0.120.0090.00115.46
8.0.110.0080.00115.36
8.0.100.0080.00215.49
8.0.90.0040.00615.36
8.0.80.0110.00615.43
8.0.70.0040.00715.42
8.0.60.0050.00515.32
8.0.50.0090.00115.37
8.0.30.0170.00416.03
8.0.20.0070.01016.19
8.0.10.0010.00915.51
8.0.00.0100.00516.02
7.4.330.0040.00415.03
7.4.320.0030.00316.63
7.4.300.0060.00016.66
7.4.290.0030.00316.56
7.4.280.0030.00516.67
7.4.270.0060.00316.64
7.4.260.0030.00316.53
7.4.250.0090.00215.10
7.4.240.0070.00315.64
7.4.230.0050.00515.26
7.4.220.0090.00815.18
7.4.210.0080.00815.71
7.4.200.0020.00715.10
7.4.190.0080.00413.59
7.4.180.0060.00613.60
7.4.160.0100.00515.23
7.4.150.0120.00415.51
7.4.140.0120.00416.39
7.4.130.0100.00915.61
7.4.120.0090.00715.74
7.4.110.0090.00815.18
7.4.100.0120.00515.19
7.4.90.0060.00914.98
7.4.80.0030.01216.42
7.4.70.0080.00915.09
7.4.60.0050.01115.16
7.4.50.0060.00415.11
7.4.40.0080.00814.90
7.4.30.0100.00514.94
7.4.20.0080.00413.43
7.4.10.0070.00914.32
7.4.00.0060.01014.79
7.3.330.0030.00313.53
7.3.320.0000.00513.33
7.3.310.0060.00214.93
7.3.300.0060.00414.94
7.3.290.0080.00014.99
7.3.280.0120.00515.72
7.3.270.0050.00915.29
7.3.260.0080.00514.81
7.3.250.0080.00815.63
7.3.240.0090.00314.82
7.3.230.0060.00714.88
7.3.220.0080.00013.27
7.3.210.0080.00914.96
7.3.200.0100.00616.14
7.3.190.0010.01114.83
7.3.180.0100.00615.04
7.3.170.0080.00714.92
7.3.160.0080.00514.91
7.3.150.0090.00013.25
7.3.140.0050.00313.13
7.3.130.0100.00514.14
7.3.120.0050.01014.54
7.3.110.0080.00714.50
7.3.100.0070.00514.57
7.3.90.0060.00714.62
7.3.80.0090.00514.47
7.3.70.0070.00514.51
7.3.60.0080.00514.64
7.3.50.0060.01014.53
7.3.40.0040.00714.43
7.3.30.0030.00814.48
7.3.20.0040.00816.22
7.3.10.0070.00716.24
7.3.00.0070.00416.28
7.2.340.0060.00613.54
7.2.330.0110.00614.96
7.2.320.0090.00615.00
7.2.310.0050.01015.22
7.2.300.0040.01015.12
7.2.290.0110.00715.24
7.2.280.0080.00413.38
7.2.270.0040.00913.35
7.2.260.0100.00614.32
7.2.250.0050.01214.64
7.2.240.0080.00814.72
7.2.230.0070.00814.72
7.2.220.0090.00614.74
7.2.210.0040.01114.75
7.2.200.0080.00614.71
7.2.190.0060.00714.83
7.2.180.0050.00814.69
7.2.170.0070.00814.70
7.2.160.0080.00714.42
7.2.150.0080.00716.24
7.2.140.0040.01116.40
7.2.130.0060.00516.31
7.2.120.0060.00716.33
7.2.110.0040.00716.40
7.2.100.0050.00916.34
7.2.90.0080.00616.24
7.2.80.0070.00816.22
7.2.70.0100.00316.19
7.2.60.0070.00816.68
7.2.50.0080.00716.35
7.2.40.0080.00516.43
7.2.30.0120.00316.31
7.2.20.0060.00516.34
7.2.10.0100.00216.21
7.2.00.0060.00817.49
7.1.330.0080.00715.50
7.1.320.0060.00715.52
7.1.310.0070.00715.47
7.1.300.0110.00315.55
7.1.290.0080.00515.45
7.1.280.0090.00415.56
7.1.270.0060.00615.38
7.1.260.0090.00515.52
7.1.250.0100.00415.27
7.1.240.0020.01115.30
7.1.230.0040.01015.23
7.1.220.0050.00715.12
7.1.210.0080.00415.11
7.1.200.0090.00315.45
7.1.190.0050.01015.14
7.1.180.0060.00915.28
7.1.170.0070.00615.26
7.1.160.0050.00715.24
7.1.150.0050.00915.04
7.1.140.0080.00415.13
7.1.130.0100.00515.24
7.1.120.0050.00915.15
7.1.110.0090.00415.25
7.1.100.0090.00716.25
7.1.90.0080.00415.21
7.1.80.0100.00315.26
7.1.70.0060.00715.79
7.1.60.0050.00816.63
7.1.50.0090.00515.82
7.1.40.0050.00815.34
7.1.30.0110.00315.27
7.1.20.0060.00715.20
7.1.10.0080.00315.24
7.1.00.0050.03217.61
7.0.330.0090.00415.00
7.0.320.0070.00615.04
7.0.310.0100.00414.97
7.0.300.0110.00314.95
7.0.290.0050.00614.96
7.0.280.0070.00715.04
7.0.270.0040.00714.93
7.0.260.0070.00514.87
7.0.250.0060.00815.13
7.0.240.0050.00714.98
7.0.230.0060.00714.91
7.0.220.0040.01014.88
7.0.210.0070.00415.09
7.0.200.0150.00514.98
7.0.190.0070.00514.88
7.0.180.0090.00315.01
7.0.170.0080.00315.07
7.0.160.0060.00814.99
7.0.150.0050.00614.94
7.0.140.0060.02617.40
7.0.130.0060.00715.13
7.0.120.0070.00914.97
7.0.110.0090.00314.71
7.0.100.0070.00714.92
7.0.90.0090.00514.88
7.0.80.0080.00514.91
7.0.70.0060.00714.82
7.0.60.0050.03316.61
7.0.50.0120.02215.95
7.0.40.0030.03416.10
7.0.30.0130.01716.08
7.0.20.0130.02416.08
7.0.10.0080.01916.12
7.0.00.0080.01816.12
5.6.400.0090.00613.71
5.6.390.0040.01113.41
5.6.380.0040.00813.80
5.6.370.0040.00613.63
5.6.360.0030.01113.81
5.6.350.0030.01013.72
5.6.340.0020.01013.72
5.6.330.0070.00713.69
5.6.320.0100.00413.72
5.6.310.0080.00413.81
5.6.300.0080.00313.52
5.6.290.0090.00613.77
5.6.280.0030.03216.06
5.6.270.0110.00313.82
5.6.260.0070.00513.60
5.6.250.0070.00513.68
5.6.240.0080.00413.86
5.6.230.0060.00613.85
5.6.220.0080.00613.71
5.6.210.0010.02216.05
5.6.200.0050.02015.22
5.6.190.0040.02216.06
5.6.180.0140.02415.97
5.6.170.0150.02916.08
5.6.160.0080.02016.11
5.6.150.0060.01615.36
5.6.140.0050.02515.32
5.6.130.0080.01815.37
5.6.120.0090.02716.21
5.6.110.0080.01816.22
5.6.100.0060.02916.12
5.6.90.0100.01616.06
5.6.80.0090.02815.93
5.6.70.0080.00613.67
5.6.60.0070.00713.69
5.6.50.0030.01013.63
5.6.40.0070.00513.64
5.6.30.0100.00213.66
5.6.20.0030.00813.67
5.6.10.0050.00613.71
5.6.00.0060.00513.82
5.5.380.0070.00713.72
5.5.370.0040.00713.52
5.5.360.0030.00813.58
5.5.350.0060.03016.11
5.5.340.0070.01615.16
5.5.330.0080.03015.95
5.5.320.0600.02715.94
5.5.310.0140.03016.00
5.5.300.0040.01915.16
5.5.290.0070.01915.20
5.5.280.0070.03315.88
5.5.270.0100.02016.01
5.5.260.0140.02316.21
5.5.250.0050.02316.02
5.5.240.0100.02615.95
5.5.230.0100.00313.84
5.5.220.0030.01013.56
5.5.210.0080.00513.51
5.5.200.0100.00113.52
5.5.190.0060.00813.45
5.5.180.0070.00513.69
5.5.170.0090.00413.55
5.5.160.0100.00313.46
5.5.150.0060.00613.41
5.5.140.0070.00513.35
5.5.130.0040.00613.58
5.5.120.0140.00013.38
5.5.110.0090.00513.54
5.5.100.0070.00713.62
5.5.90.0030.00813.63
5.5.80.0090.00413.64
5.5.70.0030.00813.69
5.5.60.0050.00713.58
5.5.50.0080.00613.53
5.5.40.0060.00613.79
5.5.30.0070.00613.74
5.5.20.0070.00413.61
5.5.10.0040.01013.55
5.5.00.0110.00013.76
5.4.450.0170.01515.09
5.4.440.0270.01415.04
5.4.430.0190.01715.15
5.4.420.0150.01715.00
5.4.410.0260.01615.28
5.4.400.0190.01815.21
5.4.390.0210.01515.31
5.4.380.0210.01715.18
5.4.370.0170.01015.24
5.4.360.0170.01815.13
5.4.350.0180.01715.19
5.4.340.0210.01815.15
5.4.330.0030.00712.04
5.4.320.0180.01815.18
5.4.310.0240.01515.16
5.4.300.0360.00915.26
5.4.290.0210.01715.29
5.4.280.0180.01815.21
5.4.270.0330.01515.26
5.4.260.0300.01315.09
5.4.250.0270.01015.27
5.4.240.0220.01915.25
5.4.230.0190.01515.19
5.4.220.0290.01715.05
5.4.210.0190.01315.14
5.4.200.0190.02015.12
5.4.190.0270.01615.18
5.4.180.0290.01815.07
5.4.170.0270.01215.12
5.4.160.0290.01415.22
5.4.150.0320.01515.17
5.4.140.0320.01715.17
5.4.130.0250.01615.22
5.4.120.0230.01315.23
5.4.110.0260.01315.15
5.4.100.0290.01315.29
5.4.90.0130.01715.41
5.4.80.0220.01615.31
5.4.70.0300.01315.20
5.4.60.0190.01515.24
5.4.50.0220.01215.12
5.4.40.0260.01615.24
5.4.30.0290.01215.25
5.4.20.0140.01615.22
5.4.10.0250.01615.31
5.4.00.0180.02015.21
5.3.290.0220.02317.09
5.3.280.0290.01717.03
5.3.270.0330.02217.05
5.3.260.0190.02017.11
5.3.250.0360.02317.06
5.3.240.0330.02317.12
5.3.230.0310.02117.04
5.3.220.0190.02117.05
5.3.210.0230.02617.12
5.3.200.0320.02117.14
5.3.190.0290.02317.17
5.3.180.0240.02417.12
5.3.170.0280.03417.21
5.3.160.0310.02217.11
5.3.150.0250.02217.12
5.3.140.0420.01817.19
5.3.130.0480.01917.07
5.3.120.0230.02917.08
5.3.110.0310.02017.11
5.3.100.0300.02517.21
5.3.90.0250.02017.12
5.3.80.0270.01917.16
5.3.70.0330.01917.16
5.3.60.0320.02017.17
5.3.50.0360.02417.15
5.3.40.0200.01817.07
5.3.30.0450.01317.05
5.3.20.0370.01717.13
5.3.10.0170.02017.04
5.3.00.0270.02317.04
5.2.170.0240.01516.58
5.2.160.0070.01916.69
5.2.150.0240.01516.67
5.2.140.0380.01516.53
5.2.130.0270.02216.54
5.2.120.0220.01416.67
5.2.110.0090.01916.67
5.2.100.0220.01216.67
5.2.90.0360.01316.67
5.2.80.0280.01716.63
5.2.70.0160.01916.62
5.2.60.0180.01816.55
5.2.50.0310.01516.66
5.2.40.0150.01416.57
5.2.30.0120.01916.63
5.2.20.0110.01816.56
5.2.10.0270.01616.54
5.2.00.0140.01216.49
5.1.60.0300.01416.17
5.1.50.0260.01616.22
5.1.40.0250.01616.13
5.1.30.0140.01616.16
5.1.20.0120.01416.11
5.1.10.0170.01216.07
5.1.00.0290.01316.12
5.0.50.0130.01515.82
5.0.40.0080.01215.78
5.0.30.0130.02015.78
5.0.20.0170.00815.78
5.0.10.0120.01215.78
5.0.00.0130.01615.78
4.4.90.0050.00815.78
4.4.80.0000.01215.78
4.4.70.0100.01015.78
4.4.60.0050.00715.78
4.4.50.0140.00815.78
4.4.40.0070.01715.78
4.4.30.0050.00815.78
4.4.20.0070.01015.78
4.4.10.0020.00715.78
4.4.00.0120.01515.78
4.3.110.0150.00815.78
4.3.100.0130.01115.78
4.3.90.0050.01015.78
4.3.80.0110.01215.78
4.3.70.0070.00715.78
4.3.60.0120.01015.78
4.3.50.0070.00815.78
4.3.40.0140.01015.78
4.3.30.0080.00815.78
4.3.20.0000.01115.78
4.3.10.0050.01115.78
4.3.00.0100.00815.78

preferences:
59.05 ms | 401 KiB | 5 Q