3v4l.org

run code in 300+ PHP versions simultaneously
<?php function niceAuthorsPrint(array $authors, $takeCount){ $totalAuthors = count( $authors ); $tailCount = $totalAuthors - $takeCount; $first = array_slice($authors, 0, $takeCount); $othersLabel = $tailCount == 1 ? 'other' : 'others'; $string = implode( ", ", $first ); if($tailCount > 0){ $string .= " and " . $tailCount . ' ' . $othersLabel; } return $string; } // take 3 echo niceAuthorsPrint(array( 'user1', 'user2', 'user3', 'user4', 'user5' ), 3) ."\n<br>"; // take 4 echo niceAuthorsPrint(array( 'user1', 'user2', 'user3', 'user4', 'user5' ), 4) ."\n<br>"; // take 5 echo niceAuthorsPrint(array( 'user1', 'user2', 'user3', 'user4', 'user5' ), 5) ."\n<br>"; ?>

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.4.140.0100.01017.37
8.4.130.0080.00917.79
8.4.120.0090.00620.52
8.4.110.0150.00622.55
8.4.100.0130.00717.81
8.4.90.0040.00518.88
8.4.80.0130.00819.46
8.4.70.0110.00817.76
8.4.60.0130.00420.31
8.4.50.0100.01019.27
8.4.40.0160.00317.59
8.4.30.0030.00917.86
8.4.20.0060.00620.72
8.4.10.0090.00019.48
8.3.270.0130.00716.79
8.3.260.0110.00516.66
8.3.250.0120.00620.91
8.3.240.0090.01116.46
8.3.230.0110.00516.67
8.3.220.0040.00417.48
8.3.210.0040.00316.69
8.3.200.0040.00516.75
8.3.190.0100.00916.52
8.3.180.0090.01016.72
8.3.170.0120.00616.44
8.3.160.0050.00319.06
8.3.150.0070.01117.34
8.3.140.0000.00817.40
8.3.130.0080.00018.44
8.3.120.0040.00420.86
8.3.110.0060.01220.94
8.3.100.0060.00324.06
8.3.90.0070.01326.77
8.3.80.0000.00919.36
8.3.70.0110.00416.75
8.3.60.0120.00618.14
8.3.50.0100.00418.06
8.3.40.0110.01118.60
8.3.30.0120.00318.58
8.3.20.0050.00318.74
8.3.10.0030.00623.70
8.3.00.0000.00821.61
8.2.290.0110.00720.34
8.2.280.0100.00818.10
8.2.270.0100.01017.04
8.2.260.0040.00416.72
8.2.250.0140.00016.58
8.2.240.0060.00317.35
8.2.230.0060.00322.58
8.2.220.0060.00337.54
8.2.210.0090.00926.77
8.2.200.0090.00018.88
8.2.190.0150.00018.17
8.2.180.0170.00318.08
8.2.170.0070.01418.82
8.2.160.0100.00322.96
8.2.150.0080.00025.66
8.2.140.0000.01124.66
8.2.130.0000.00819.91
8.2.120.0060.01326.35
8.2.110.0070.00419.11
8.2.100.0080.00417.78
8.2.90.0080.00020.64
8.2.80.0040.00418.05
8.2.70.0060.00318.05
8.2.60.0040.00418.16
8.2.50.0000.00918.10
8.2.40.0080.00019.54
8.2.30.0030.00520.50
8.2.20.0030.00618.13
8.2.10.0030.00818.13
8.2.00.0000.00819.55
8.1.330.0020.00622.20
8.1.320.0110.01015.99
8.1.310.0070.00716.23
8.1.300.0060.00317.71
8.1.290.0040.00430.84
8.1.280.0070.01025.92
8.1.270.0120.00623.99
8.1.260.0100.00726.35
8.1.250.0150.00328.09
8.1.240.0040.00821.87
8.1.230.0040.00722.66
8.1.220.0040.00417.74
8.1.210.0070.00019.02
8.1.200.0040.00717.25
8.1.190.0060.00317.23
8.1.180.0030.00618.10
8.1.170.0030.00618.39
8.1.160.0000.00718.82
8.1.150.0040.00418.94
8.1.140.0000.00820.54
8.1.130.0030.00321.96
8.1.120.0050.00317.45
8.1.110.0070.00017.35
8.1.100.0040.00717.35
8.1.90.0040.00417.45
8.1.80.0040.00417.46
8.1.70.0040.00417.36
8.1.60.0040.00417.47
8.1.50.0000.00917.49
8.1.40.0080.00017.46
8.1.30.0030.00617.54
8.1.20.0040.00417.68
8.1.10.0080.00017.46
8.1.00.0040.00417.48
8.0.300.0030.00320.07
8.0.290.0040.00416.63
8.0.280.0080.00018.46
8.0.270.0050.00216.74
8.0.260.0030.00320.07
8.0.250.0030.00316.98
8.0.240.0080.00016.98
8.0.230.0000.00716.96
8.0.220.0050.00216.80
8.0.210.0030.00316.79
8.0.200.0030.00316.84
8.0.190.0040.00416.98
8.0.180.0040.00416.95
8.0.170.0000.00816.93
8.0.160.0040.00416.83
8.0.150.0000.00716.78
8.0.140.0070.00016.87
8.0.130.0030.00313.29
8.0.120.0030.00516.77
8.0.110.0000.00716.76
8.0.100.0030.00516.81
8.0.90.0000.00716.95
8.0.80.0030.01216.87
8.0.70.0000.00716.71
8.0.60.0000.00716.75
8.0.50.0070.00016.69
8.0.30.0090.00817.00
8.0.20.0110.00917.40
8.0.10.0050.00216.98
8.0.00.0080.01116.92
7.4.330.0000.00515.55
7.4.320.0070.00016.61
7.4.300.0000.00616.51
7.4.290.0000.00716.56
7.4.280.0040.00416.52
7.4.270.0030.00616.50
7.4.260.0070.00016.58
7.4.250.0040.00416.43
7.4.240.0030.00516.56
7.4.230.0040.00416.39
7.4.220.0030.00516.61
7.4.210.0070.00816.56
7.4.200.0030.00316.50
7.4.160.0090.00816.48
7.4.140.0140.00817.86
7.4.130.0100.00716.55
7.4.120.0100.00716.50
7.4.110.0110.00716.48
7.4.100.0090.01516.57
7.4.90.0100.00716.36
7.4.80.0160.00819.39
7.4.70.0030.01316.48
7.4.60.0130.00416.34
7.4.50.0040.01416.51
7.4.40.0100.01016.50
7.4.10.0070.01114.92
7.4.00.0140.00214.87
7.3.330.0020.00213.08
7.3.320.0030.00313.09
7.3.310.0000.00716.20
7.3.300.0000.00716.34
7.3.290.0000.00716.17
7.3.280.0060.01116.29
7.3.260.0100.00916.48
7.3.240.0090.01116.60
7.3.230.0170.00016.42
7.3.210.0060.01216.73
7.3.200.0140.00316.61
7.3.190.0100.01716.48
7.3.180.0070.01316.28
7.3.170.0060.01016.60
7.3.160.0060.00916.30
7.3.130.0160.00014.93
7.3.120.0070.01014.91
7.3.110.0040.01514.62
7.3.100.0130.00014.98
7.3.90.0030.00814.66
7.3.80.0070.01014.72
7.3.70.0090.00614.78
7.3.60.0030.01314.56
7.3.50.0070.00714.77
7.3.40.0040.01114.91
7.3.30.0000.01414.73
7.3.20.0000.01116.54
7.3.10.0030.00916.75
7.3.00.0100.00716.79
7.2.330.0130.00916.50
7.2.320.0090.01416.75
7.2.310.0070.01316.69
7.2.300.0130.00316.40
7.2.290.0060.01116.87
7.2.260.0030.01315.32
7.2.250.0100.01014.76
7.2.240.0030.01214.79
7.2.230.0030.01314.88
7.2.220.0150.00414.76
7.2.210.0100.00615.01
7.2.200.0070.00714.96
7.2.190.0070.00314.82
7.2.180.0100.00714.87
7.2.170.0040.01514.89
7.2.160.0090.00614.83
7.2.150.0060.01016.92
7.2.140.0060.00916.99
7.2.130.0070.01316.57
7.2.120.0070.00316.90
7.2.110.0090.00616.89
7.2.100.0080.00316.72
7.2.90.2270.00515.86
7.2.80.1730.00915.86
7.2.70.1810.00916.05
7.2.60.0590.00716.02
7.2.50.1610.01015.94
7.2.40.1730.00615.88
7.2.30.2090.00415.66
7.2.20.1870.01215.73
7.2.10.2000.00815.87
7.2.00.1590.01115.92
7.1.330.0060.00615.91
7.1.320.0100.00715.69
7.1.310.0140.00015.69
7.1.300.0030.00715.76
7.1.290.0080.00615.50
7.1.280.0070.00715.61
7.1.270.0070.00315.75
7.1.260.0080.00815.49
7.1.250.0110.00615.59
7.1.240.0070.00415.79
7.1.230.0080.00815.73
7.1.220.0030.01315.55
7.1.210.1850.00314.69
7.1.200.2150.00914.79
7.1.190.1670.00914.86
7.1.180.1910.00214.69
7.1.170.1600.00514.81
7.1.160.1470.01214.67
7.1.150.1480.00914.49
7.1.140.1560.00714.66
7.1.130.1890.00914.58
7.1.120.1360.01114.71
7.1.110.1610.01014.84
7.1.100.1230.00614.64
7.1.90.1060.01014.58
7.1.80.0290.00614.68
7.1.70.0090.00714.76
7.1.60.0200.01123.73
7.1.50.0220.00923.77
7.1.40.1650.01223.72
7.1.30.0170.00523.59
7.1.20.0230.00923.67
7.1.10.1030.00914.79
7.1.00.0270.00714.55
7.0.330.0040.01415.38
7.0.320.0030.00915.35
7.0.310.0090.00615.08
7.0.300.0120.00315.05
7.0.290.0040.00715.42
7.0.280.0120.00015.39
7.0.270.0030.00915.55
7.0.260.0100.00715.38
7.0.250.0120.00315.40
7.0.240.0110.00415.54
7.0.230.0000.01515.50
7.0.220.0030.01015.48
7.0.210.0040.00815.45
7.0.200.0030.01215.47
7.0.190.0090.00615.51
7.0.180.0040.00815.47
7.0.170.0060.00615.41
7.0.160.0060.00615.49
7.0.150.0030.00915.23
7.0.140.0030.00715.27
7.0.130.0130.00015.52
7.0.120.0030.01215.49
7.0.110.0090.00015.34
7.0.100.0040.01115.43
7.0.90.0070.00715.44
7.0.80.0060.00615.36
7.0.70.0080.00315.45
7.0.60.0100.00315.43
7.0.50.0100.00315.70
7.0.40.0040.00713.46
7.0.30.0090.00613.13
7.0.20.0040.01113.18
7.0.10.0080.00813.37
7.0.00.0060.01013.41
5.6.400.0060.01314.71
5.6.390.0070.01114.40
5.6.380.0030.00714.27
5.6.370.0060.00914.50
5.6.360.0100.00714.23
5.6.350.0030.01314.27
5.6.340.0070.00714.32
5.6.330.0070.00714.05
5.6.320.0090.00614.28
5.6.310.0070.00714.10
5.6.300.0060.00914.59
5.6.290.0030.00714.53
5.6.280.0040.00814.70
5.6.270.0100.00014.33
5.6.260.0050.00514.36
5.6.250.0040.00714.59
5.6.240.0030.00914.63
5.6.230.0090.00614.31
5.6.220.0120.00314.43
5.6.210.0030.01314.28
5.6.200.0070.01114.42
5.6.190.0070.00714.02
5.6.180.0070.00714.19
5.6.170.0070.01014.34
5.6.160.0100.00714.24
5.6.150.0110.00714.74
5.6.140.0130.00314.18
5.6.130.0030.01014.28
5.6.120.0060.00614.18
5.6.110.0040.00414.27
5.6.100.0040.01014.43
5.6.90.0000.01614.45
5.6.80.0060.00314.08
5.6.70.0060.00914.14
5.6.60.0130.00314.41
5.6.50.0090.00614.18
5.6.40.0040.00914.39
5.6.30.0030.00614.16
5.6.20.0100.00313.96
5.6.10.0000.00914.47
5.6.00.0040.01114.20

preferences:
92.94 ms | 403 KiB | 5 Q