3v4l.org

run code in 300+ PHP versions simultaneously
<?php function group($cond, $arr) { if (!$arr) return []; $e = array_shift($arr); $g = [$e]; while($cond($e, reset($arr))) { $g[] = array_shift($arr); } return array_merge([$g], group($cond, $arr)); } function it($m,$p){echo ($p?'OK':'NO')." It $m\n";} function eq($a,$b) {return $a==$b;} echo it ('groups', group($eq, [1,5,5,6,6,6,7,9]) == [[1],[5,5],[6,6,6],[7],[9]]); print_r(group($eq, [1,2,3,3,3,4,6]));

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.0060.00918.46
8.3.50.0160.00321.21
8.3.40.0070.00718.79
8.3.30.0000.01419.07
8.3.20.0070.00020.03
8.3.10.0080.00023.48
8.3.00.0080.00019.51
8.2.180.0100.00716.50
8.2.170.0080.00822.96
8.2.160.0070.00720.57
8.2.150.0040.00424.18
8.2.140.0090.00024.66
8.2.130.0030.00526.16
8.2.120.0030.00522.15
8.2.110.0060.00320.25
8.2.100.0060.00618.22
8.2.90.0030.00619.30
8.2.80.0040.00417.97
8.2.70.0000.00817.75
8.2.60.0040.00418.04
8.2.50.0040.00418.07
8.2.40.0040.00419.97
8.2.30.0000.00718.02
8.2.20.0000.00817.76
8.2.10.0000.00817.94
8.2.00.0040.00417.80
8.1.280.0100.00725.92
8.1.270.0060.00323.71
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0050.00523.92
8.1.230.0080.00419.09
8.1.220.0000.00817.74
8.1.210.0090.00018.77
8.1.200.0000.00917.23
8.1.190.0000.00917.35
8.1.180.0000.00818.10
8.1.170.0060.00618.71
8.1.160.0000.00721.98
8.1.150.0050.00218.90
8.1.140.0000.00717.38
8.1.130.0040.00417.68
8.1.120.0070.00017.52
8.1.110.0040.00417.43
8.1.100.0050.00217.49
8.1.90.0000.00717.36
8.1.80.0000.00717.49
8.1.70.0040.00417.40
8.1.60.0040.00417.60
8.1.50.0080.00017.41
8.1.40.0060.00317.50
8.1.30.0050.00317.66
8.1.20.0050.00317.64
8.1.10.0000.00717.57
8.1.00.0040.00417.49
8.0.300.0050.00318.77
8.0.290.0040.00416.75
8.0.280.0070.00018.36
8.0.270.0030.00317.25
8.0.260.0060.00017.28
8.0.250.0030.00417.05
8.0.240.0040.00416.86
8.0.230.0050.00216.90
8.0.220.0070.00016.97
8.0.210.0070.00016.98
8.0.200.0000.00717.04
8.0.190.0040.00416.95
8.0.180.0030.00516.87
8.0.170.0050.00317.00
8.0.160.0000.00717.00
8.0.150.0000.00716.89
8.0.140.0000.00716.96
8.0.130.0050.00013.38
8.0.120.0050.00316.88
8.0.110.0040.00417.03
8.0.100.0040.00416.99
8.0.90.0030.00516.91
8.0.80.0100.01017.02
8.0.70.0070.00017.06
8.0.60.0050.00317.06
8.0.50.0000.00716.89
8.0.30.0130.00716.94
8.0.20.0150.00717.40
8.0.10.0050.00317.09
8.0.00.0090.00916.90
7.4.330.0050.00015.02
7.4.320.0060.00316.59
7.4.300.0060.00016.50
7.4.290.0000.00716.50
7.4.280.0070.00016.39
7.4.270.0030.00316.63
7.4.260.0040.00416.49
7.4.250.0040.00416.61
7.4.240.0070.00016.66
7.4.230.0030.00316.37
7.4.220.0060.01316.59
7.4.210.0120.00816.63
7.4.200.0030.00316.45
7.4.160.0130.00316.40
7.4.150.0170.00717.40
7.4.140.0090.01017.86
7.4.130.0090.00916.51
7.4.120.0100.00816.49
7.4.110.0110.00716.36
7.4.100.0140.00316.51
7.4.90.0070.01016.54
7.4.80.0140.00519.39
7.4.70.0140.00316.60
7.4.60.0130.00716.55
7.4.50.0000.00816.43
7.4.40.0060.01216.55
7.4.30.0070.01016.58
7.4.00.0030.01114.97
7.3.330.0060.00013.41
7.3.320.0030.00313.39
7.3.310.0020.00516.41
7.3.300.0000.00716.43
7.3.290.0100.00616.43
7.3.280.0100.00516.42
7.3.270.0090.00917.40
7.3.260.0130.01016.24
7.3.250.0160.00116.60
7.3.240.0060.01216.35
7.3.230.0080.00816.39
7.3.210.0060.01216.37
7.3.200.0100.00719.39
7.3.190.0150.00316.45
7.3.180.0090.00616.51
7.3.170.0120.00616.30
7.3.160.0060.00916.43
7.3.120.0000.01615.11
7.3.110.0060.01015.04
7.3.100.0130.00714.82
7.3.90.0120.00614.79
7.3.80.0090.00614.77
7.3.70.0080.00514.90
7.3.60.0060.00614.95
7.3.50.0070.00314.91
7.3.40.0030.00714.76
7.3.30.0040.01114.83
7.3.20.0000.01816.81
7.3.10.0080.00516.51
7.3.00.0090.00416.62
7.2.330.0070.01016.71
7.2.320.0110.00616.86
7.2.310.0030.01316.40
7.2.300.0180.00316.73
7.2.290.0160.00616.53
7.2.250.0140.00315.08
7.2.240.0030.01715.17
7.2.230.0030.01414.93
7.2.220.0030.01015.23
7.2.210.0070.00714.87
7.2.200.0030.01415.13
7.2.190.0090.00614.98
7.2.180.0070.01115.20
7.2.170.0080.00815.09
7.2.130.0000.00916.80
7.2.120.0060.00916.84
7.2.110.0130.00316.62
7.2.100.0040.00416.63
7.2.90.0040.00716.68
7.2.80.0170.00316.74
7.2.70.0080.00816.84
7.2.60.0080.00516.85
7.2.50.0030.00916.74
7.2.40.0070.00516.84
7.2.30.0060.00616.86
7.2.20.0000.01316.66
7.2.10.0080.01216.50
7.2.00.0050.01018.10
7.1.330.0040.01115.78
7.1.320.0100.00315.87
7.1.310.0090.00015.79
7.1.300.0030.01016.00
7.1.290.0060.00315.89
7.1.280.0120.00315.66
7.1.270.0060.00615.82
7.1.260.0030.00715.90
7.1.250.0120.00315.85
7.1.200.0040.00815.80
7.1.100.0070.00718.32
7.1.70.0080.00417.10
7.1.60.0160.00919.11
7.1.50.0060.00616.96
7.1.00.0000.07722.44
7.0.200.0030.00616.48
7.0.140.0130.06322.12
7.0.60.0100.08320.00
7.0.50.0070.05317.88
7.0.40.0100.08320.19
7.0.30.0270.04020.13
7.0.20.0230.07720.23
7.0.10.0070.04720.19
7.0.00.0100.08720.08
5.6.280.0030.07320.93
5.6.210.0000.04320.75
5.6.200.0100.03318.18
5.6.190.0230.07020.54
5.6.180.0230.08020.61
5.6.170.0000.04720.56
5.6.160.0100.05720.50
5.6.150.0070.05318.14
5.6.140.0070.04718.17
5.6.130.0030.05318.28
5.6.120.0030.05321.14
5.6.110.0170.06721.02
5.6.100.0070.08320.98
5.6.90.0030.04721.04
5.6.80.0070.07020.36
5.5.350.4030.03320.44
5.5.340.0030.04718.07
5.5.330.0030.05020.57
5.5.320.0400.06720.27
5.5.310.0200.07320.19
5.5.300.0030.04017.98
5.5.290.0100.07717.98
5.5.280.0070.07020.74
5.5.270.0000.08320.73
5.5.260.0100.04720.77
5.5.250.0100.06720.76
5.5.240.0200.06720.38
5.4.450.3570.04319.57
5.4.440.0070.04019.27
5.4.430.1400.06719.25
5.4.420.3470.04319.26
5.4.410.3600.03319.32
5.4.400.3730.02319.22
5.4.390.4000.03719.24
5.4.380.3570.03319.21
5.4.370.4170.04318.95
5.4.360.3800.04019.18
5.4.350.4170.04019.15
5.4.340.3870.03718.93
5.4.320.3900.03718.93
5.4.310.3870.03718.93
5.4.300.4930.03019.03
5.4.290.3870.03718.93
5.4.280.3600.04719.17
5.4.270.3800.04019.14
5.4.260.3630.04019.11
5.4.250.3570.04319.11
5.4.240.4630.03319.14
5.4.230.4100.04319.21
5.4.220.4230.03319.21
5.4.210.2000.03718.94
5.4.200.0000.04719.10
5.4.190.4400.04019.14
5.4.180.4330.04018.96
5.4.170.3900.03719.23
5.4.160.4100.05019.22
5.4.150.3870.03019.20
5.4.140.3630.03716.56
5.4.130.3670.04016.39
5.4.120.3870.03716.50
5.4.110.0070.07016.50
5.4.100.0070.03716.60
5.4.90.3330.03716.57
5.4.80.3870.03316.58
5.4.70.3700.03016.56
5.4.60.3800.03716.33
5.4.50.3530.03716.30
5.4.40.3770.04016.49
5.4.30.3630.04016.30
5.4.20.3800.04016.41
5.4.10.4200.04016.45
5.4.00.5270.04315.80
5.3.290.3900.04314.72
5.3.280.3830.03714.61
5.3.270.4300.04014.64
5.3.260.3870.04014.53
5.3.250.3970.02714.66
5.3.240.3830.04014.77
5.3.230.3770.04014.61
5.3.220.3770.03314.57
5.3.210.2770.04314.57
5.3.200.0070.04314.61
5.3.190.3530.04014.61
5.3.180.3530.04314.60
5.3.170.3600.03314.72
5.3.160.3570.03314.62
5.3.150.3570.03714.62
5.3.140.3830.04314.47
5.3.130.4100.03714.55
5.3.120.3630.03314.61
5.3.110.3470.04014.44
5.3.100.3570.04314.05
5.3.90.3470.03314.08
5.3.80.3930.03714.16
5.3.70.4000.03014.01
5.3.60.3870.03314.04
5.3.50.3670.03313.89
5.3.40.3330.03313.91
5.3.30.3800.03013.79
5.3.20.3530.04013.68
5.3.10.3670.03013.55
5.3.00.3730.03313.68
5.2.170.2770.02311.20
5.2.160.2970.03011.20
5.2.150.3530.03711.19
5.2.140.3200.02711.13
5.2.130.3070.02311.19
5.2.120.2730.02711.10
5.2.110.3030.02711.13
5.2.100.3030.02711.05
5.2.90.3030.02311.05
5.2.80.3530.03711.18
5.2.70.3000.02711.05
5.2.60.3030.03311.19
5.2.50.3200.02311.17
5.2.40.2530.02311.03
5.2.30.2600.02710.96
5.2.20.2630.02710.98
5.2.10.2830.02711.02
5.2.00.3100.03010.71
5.1.60.2930.0279.97
5.1.50.2800.0279.94
5.1.40.2600.0279.98
5.1.30.2470.02710.26
5.1.20.2430.02010.34
5.1.10.2370.02710.09
5.1.00.2400.02310.06
5.0.50.1530.0138.59
5.0.40.1730.0238.38
5.0.30.1530.0308.26
5.0.20.1670.0208.27
5.0.10.1470.0178.31
5.0.00.1430.0378.18
4.4.90.1170.0136.20
4.4.80.1330.0136.20
4.4.70.1370.0206.20
4.4.60.1430.0136.20
4.4.50.1670.0136.20
4.4.40.1630.0276.20
4.4.30.1400.0176.20
4.4.20.1200.0136.20
4.4.10.1600.0176.20
4.4.00.1600.0236.20
4.3.110.1730.0176.20
4.3.100.1730.0136.20
4.3.90.0900.0176.20
4.3.80.1400.0236.20
4.3.70.1570.0176.20
4.3.60.1470.0136.20
4.3.50.1300.0176.20
4.3.40.1500.0276.20
4.3.30.0700.0206.20
4.3.20.0800.0236.20
4.3.10.0670.0176.20
4.3.00.0630.0136.20

preferences:
37.01 ms | 401 KiB | 5 Q