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";}; echo it ('groups', group(function ($x) { return $x < 3; }, [1,5,5,6,6,6,7,9]) == [[1],[5,5],[6,6,6],[7],[9]]);

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.0270.22950.48
8.3.50.0830.25549.91
8.3.40.0460.12136.01
8.3.30.0340.11136.04
8.3.20.0100.06237.33
8.3.10.0030.06439.77
8.3.00.0070.06335.67
8.2.180.0800.18149.52
8.2.170.0300.10135.74
8.2.160.0420.09837.51
8.2.150.0200.07036.00
8.2.140.0070.06636.04
8.2.130.0160.05338.35
8.2.120.0200.04938.16
8.2.110.0230.08838.48
8.2.100.0300.07634.64
8.2.90.0170.08036.25
8.2.80.0070.08434.58
8.2.70.0170.07434.72
8.2.60.0230.08335.02
8.2.50.0030.09434.58
8.2.40.0130.07836.18
8.2.30.0100.09435.20
8.2.20.0160.08134.85
8.2.10.0130.09435.09
8.2.00.0200.08034.89
8.1.280.0700.11750.16
8.1.270.0200.03439.11
8.1.260.0170.03136.89
8.1.250.0100.04239.05
8.1.240.0160.04938.80
8.1.230.0280.03534.99
8.1.220.0160.03834.74
8.1.210.0070.05234.64
8.1.200.0130.04234.08
8.1.190.0170.03734.13
8.1.180.0170.04034.63
8.1.170.0160.05335.52
8.1.160.0130.04339.16
8.1.150.0130.04935.98
8.1.140.0110.05434.45
8.1.130.0070.04634.84
8.1.120.0030.05534.62
8.1.110.0170.04634.54
8.1.100.0070.05334.58
8.1.90.0130.04934.48
8.1.80.0130.04134.43
8.1.70.0230.03634.55
8.1.60.0200.04734.57
8.1.50.0100.05434.66
8.1.40.0130.05034.50
8.1.30.0070.05934.71
8.1.20.0130.04734.57
8.1.10.0170.09850.69
8.1.00.0230.09250.45
8.0.300.0330.08350.10
8.0.290.0200.09349.61
8.0.280.0170.09951.39
8.0.270.0240.09350.19
8.0.260.0230.09150.26
8.0.250.0270.09349.82
8.0.240.0170.09749.79
8.0.230.0170.10049.84
8.0.220.0130.10049.71
8.0.210.0130.09749.84
8.0.200.0170.09749.86
8.0.190.0270.09449.77
8.0.180.0100.10449.86
8.0.170.0200.09849.88
8.0.160.0240.09149.90
8.0.150.0270.08749.70
8.0.140.0270.09649.67
8.0.130.0370.20178.25
8.0.120.0260.08949.77
8.0.110.0300.09449.68
8.0.100.0100.10249.84
8.0.90.0130.10849.83
8.0.80.0550.17349.82
8.0.70.0200.09749.65
8.0.60.0230.09249.75
8.0.50.0170.09549.84
8.0.30.0610.18649.73
8.0.20.0590.17750.01
8.0.10.0330.08349.96
8.0.00.0760.17449.71
7.4.330.0130.09747.02
7.4.320.0460.10949.43
7.4.300.0260.08549.27
7.4.290.0340.08149.39
7.4.280.0330.09249.27
7.4.270.0420.07849.46
7.4.260.0130.10649.46
7.4.250.0230.09649.40
7.4.240.0270.09049.35
7.4.230.0240.09149.24
7.4.220.0900.19449.51
7.4.210.0830.23249.54
7.4.200.0230.09749.58
7.4.160.0510.16249.32
7.4.150.0690.17249.49
7.4.140.0750.18249.55
7.4.130.0460.19549.39
7.4.120.0810.19049.46
7.4.110.0770.29249.53
7.4.100.0680.16249.48
7.4.90.0640.16949.44
7.4.80.0610.17249.57
7.4.70.0590.20649.57
7.4.60.0620.20049.54
7.4.50.0230.08349.35
7.4.40.0690.16049.56
7.4.30.0680.25449.53
7.4.00.0260.15247.78
7.3.330.0540.20678.18
7.3.320.0840.21078.16
7.3.310.0240.10249.11
7.3.300.0230.10349.18
7.3.290.0550.19349.28
7.3.280.0580.16349.24
7.3.270.0640.16849.48
7.3.260.0690.23449.31
7.3.250.0650.17249.49
7.3.240.0990.21849.38
7.3.230.0520.18049.44
7.3.210.0680.21549.32
7.3.200.0570.18549.31
7.3.190.0560.19749.42
7.3.180.0700.20149.37
7.3.170.0760.17949.37
7.3.160.0970.15649.29
7.3.00.1620.15350.49
7.2.330.0680.16049.78
7.2.320.0430.19649.54
7.2.310.0710.14749.42
7.2.300.0590.15849.44
7.2.290.0740.28949.51
7.2.130.0920.17050.72
7.2.120.0460.18350.93
7.2.110.0300.19750.75
7.2.100.0070.17850.82
7.2.90.0170.16350.88
7.2.80.0170.17350.89
7.2.70.0160.16850.80
7.2.60.0380.13150.74
7.2.50.0230.16250.97
7.2.40.0230.15550.79
7.2.30.0230.14750.77
7.2.20.0070.16350.80
7.2.10.0160.15850.51
7.2.00.0900.13251.10
7.1.250.0530.25449.79
7.1.240.0260.24949.84
7.1.230.0150.28349.72
7.1.220.0160.29749.64
7.1.210.0190.23249.66
7.1.200.0630.17849.69
7.1.190.0200.24449.80
7.1.180.0230.24749.51
7.1.170.0200.25449.46
7.1.160.0130.24749.59
7.1.150.0100.24649.93
7.1.140.0070.26749.94
7.1.130.0070.25749.57
7.1.120.0290.25149.29
7.1.110.0200.24849.75
7.1.100.0140.17650.82
7.1.90.0170.25949.86
7.1.80.0100.26349.90
7.1.70.0790.17450.27
7.1.60.0130.19550.56
7.1.50.0380.20650.22
7.1.40.0170.23749.74
7.1.30.0200.25149.84
7.1.20.0300.25649.67
7.1.10.0190.26149.52
7.1.00.0160.24753.06
7.0.330.0530.26249.64
7.0.320.0200.28849.37
7.0.310.0070.27949.41
7.0.300.0230.25749.33
7.0.290.0260.25449.45
7.0.280.0100.25049.03
7.0.270.0130.24549.48
7.0.260.0070.26749.02
7.0.250.0100.24349.46
7.0.240.0130.24449.20
7.0.230.0130.25749.20
7.0.220.0070.25549.49
7.0.210.0100.24349.43
7.0.200.0260.18349.94
7.0.190.0160.25249.37
7.0.180.0130.29249.20
7.0.170.0230.25649.54
7.0.160.0070.26349.23
7.0.150.0130.26749.30
7.0.140.0110.23452.81
7.0.130.0100.25249.61
7.0.120.0170.24849.36
7.0.110.0100.25849.29
7.0.100.0100.26049.26
7.0.90.0330.23149.15
7.0.80.0160.26749.00
7.0.70.0230.25849.38
7.0.60.0210.22051.09
7.0.50.0180.21650.25
7.0.40.0270.21049.44
7.0.30.0450.21649.64
7.0.20.0730.22349.60
7.0.10.0130.22549.60
7.0.00.0200.22149.62
5.6.380.0550.32379.21
5.6.370.0330.26778.79
5.6.360.0370.28078.70
5.6.350.0270.27678.91
5.6.340.0400.26178.99
5.6.330.0320.29379.06
5.6.320.0200.27778.98
5.6.310.0460.28278.97
5.6.300.0330.29079.09
5.6.290.0440.26778.65
5.6.280.0320.28782.28
5.6.270.0330.27079.09
5.6.260.0200.29379.20
5.6.250.0370.27578.97
5.6.240.0200.27679.20
5.6.230.0530.27178.86
5.6.220.0470.28378.74
5.6.210.0330.25682.03
5.6.200.0350.24880.88
5.6.190.0370.26082.01
5.6.180.0350.25182.01
5.6.170.0400.25381.81
5.6.160.0360.23181.95
5.6.150.0250.26180.91
5.6.140.0270.27780.88
5.6.130.0280.25181.13
5.6.120.0380.24282.26
5.6.110.0280.26082.33
5.6.100.0400.22882.17
5.6.90.0280.23382.13
5.6.80.0370.23781.95
5.6.70.1820.21482.09
5.6.60.0360.31778.91
5.6.50.0230.32079.09
5.6.40.0420.29178.93
5.6.30.0440.28178.87
5.6.20.0300.26578.77
5.6.10.0360.27978.94
5.6.00.0300.28778.67
5.5.380.0300.30375.90
5.5.370.0270.28676.06
5.5.360.0200.28175.71
5.5.350.0320.23680.47
5.5.340.0320.23779.22
5.5.330.0230.27080.38
5.5.320.0350.23780.29
5.5.310.0480.24380.35
5.5.300.0350.21379.17
5.5.290.0120.25479.37
5.5.280.0320.22880.70
5.5.270.0370.24880.63
5.5.260.0330.27980.77
5.5.250.0400.25880.48
5.5.240.0480.21680.25
5.5.230.0330.30675.77
5.5.220.0360.28875.71
5.5.210.0560.27476.00
5.5.200.0360.31175.63
5.5.190.0330.28675.89
5.5.180.0370.27375.77
5.5.170.0330.28175.96
5.5.160.0500.23875.67
5.5.150.0460.25575.95
5.5.140.0170.27675.75
5.5.130.0300.31375.59
5.5.120.0270.28775.71
5.5.110.0130.29475.79
5.5.100.0300.27575.87
5.5.90.0470.28675.64
5.5.80.0200.28475.61
5.5.70.0200.26175.78
5.5.60.0360.32575.93
5.5.50.0330.28975.94
5.5.40.0300.26175.91
5.5.30.0460.26775.91
5.5.20.0300.28075.70
5.5.10.0630.28175.63
5.5.00.0370.25775.68
5.4.450.0980.33079.95
5.4.440.0420.29879.71
5.4.430.0480.32379.95
5.4.420.0470.28879.88
5.4.410.0520.28579.71
5.4.400.0480.29979.89
5.4.390.0530.28579.85
5.4.380.0530.29379.67
5.4.370.0380.33779.85
5.4.360.0620.32579.61
5.4.350.0650.29779.58
5.4.340.0350.27076.22
5.4.330.0200.28675.56
5.4.320.0290.29776.61
5.4.310.0330.28476.27
5.4.300.0360.27576.36
5.4.290.0330.24076.42
5.4.280.0180.26376.51
5.4.270.0270.24876.26
5.4.260.0180.27476.50
5.4.250.0330.26876.46
5.4.240.0250.24376.28
5.4.230.0200.27276.30
5.4.220.0400.25676.36
5.4.210.0330.24576.34
5.4.200.0300.26876.50
5.4.190.0350.24476.43
5.4.180.0350.28376.22
5.4.170.0340.26176.43
5.4.160.0370.25976.23
5.4.150.0290.27876.29
5.4.140.0320.26376.26
5.4.130.0350.24276.28
5.4.120.0240.27076.10
5.4.110.0270.25976.14
5.4.100.0250.25276.13
5.4.90.0300.25876.17
5.4.80.0230.25576.11
5.4.70.0240.24976.16
5.4.60.0240.24976.17
5.4.50.0240.24676.26
5.4.40.0430.24376.05
5.4.30.0360.26376.22
5.4.20.0240.28276.33
5.4.10.0310.25776.29
5.4.00.0340.25575.92
5.3.290.0040.02211.48
5.3.280.0040.02611.53
5.3.270.0040.03311.51
5.3.260.0050.02311.51
5.3.250.0050.01911.53
5.3.240.0060.02011.45
5.3.230.0050.02111.33
5.3.220.0040.02111.46
5.3.210.0070.02011.49
5.3.200.0020.02311.44
5.3.190.0050.02211.47
5.3.180.0050.02211.54
5.3.170.0060.02011.56
5.3.160.0060.02211.44
5.3.150.0040.02111.49
5.3.140.0050.02111.54
5.3.130.0020.02311.48
5.3.120.0080.01911.51
5.3.110.0080.01811.51
5.3.100.0040.02011.25
5.3.90.0050.01911.15
5.3.80.0050.01911.19
5.3.70.0060.01811.05
5.3.60.0030.02311.23
5.3.50.0040.01911.00
5.3.40.0030.02011.06
5.3.30.0050.01911.02
5.3.20.0030.02210.99
5.3.10.0070.01910.85
5.3.00.0050.01910.87
5.2.170.0050.0229.59
5.2.160.0080.0149.59
5.2.150.0050.0179.59
5.2.140.0020.0189.59
5.2.130.0040.0159.57
5.2.120.0040.0149.57
5.2.110.0030.0179.57
5.2.100.0040.0179.57
5.2.90.0060.0159.57
5.2.80.0050.0199.56
5.2.70.0080.0209.56
5.2.60.0060.0179.54
5.2.50.0020.0199.52
5.2.40.0020.0189.51
5.2.30.0040.0189.50
5.2.20.0040.0179.50
5.2.10.0030.0179.46
5.2.00.0040.0169.38
5.1.60.0040.0139.02
5.1.50.0050.0129.02
5.1.40.0020.0159.01
5.1.30.0070.0159.19
5.1.20.0050.0199.20
5.1.10.0020.0189.06
5.1.00.0040.0159.06
5.0.50.0020.0148.30
5.0.40.0030.0138.23
5.0.30.0050.0168.13
5.0.20.0020.0148.12
5.0.10.0040.0148.11
5.0.00.0020.0188.10
4.4.90.0020.0107.37
4.4.80.0030.0097.36
4.4.70.0010.0117.36
4.4.60.0010.0117.36
4.4.50.0010.0107.36
4.4.40.0030.0147.33
4.4.30.0020.0107.36
4.4.20.0040.0087.40
4.4.10.0050.0077.40
4.4.00.0040.0147.36
4.3.110.0020.0107.31
4.3.100.0020.0097.31
4.3.90.0020.0107.29
4.3.80.0020.0147.27
4.3.70.0050.0067.29
4.3.60.0030.0097.29
4.3.50.0020.0097.29
4.3.40.0040.0127.25
4.3.30.0020.0106.63
4.3.20.0020.0116.62
4.3.10.0020.0116.60
4.3.00.0000.0158.41

preferences:
47.25 ms | 401 KiB | 5 Q