3v4l.org

run code in 300+ PHP versions simultaneously
<?php $records = [ 'h', 1, 2, 3, 4, 'f', 'nonsense', 'h', 1, 2, 'f', 'h', 1, 2, 3, 'f', 'nonsense', 'nonsense', 'nonsense', 'h', 1, 2, 3, 4, 'f', 'h', 1, 'f', 'nonsense' ]; $groups = []; foreach ($records as $record) { if ($record === 'h') { $group = []; } $group[] = $record; if ($record === 'f') { $groups[] = $group; } } var_dump($groups);

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.0160.00618.43
8.3.50.0160.00316.47
8.3.40.0150.00618.50
8.3.30.0170.00318.71
8.3.20.0000.00921.80
8.3.10.0090.00023.71
8.3.00.0040.00418.16
8.2.180.0110.00418.16
8.2.170.0150.00022.96
8.2.160.0100.00321.12
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00419.77
8.2.110.0060.00320.39
8.2.100.0040.00819.66
8.2.90.0060.00319.00
8.2.80.0040.00417.97
8.2.70.0000.00917.50
8.2.60.0080.00018.16
8.2.50.0060.00318.10
8.2.40.0080.00022.15
8.2.30.0000.00820.97
8.2.20.0040.00418.00
8.2.10.0040.00418.07
8.2.00.0040.00418.06
8.1.280.0070.01025.92
8.1.270.0040.00423.92
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0030.00623.92
8.1.230.0050.00617.89
8.1.220.0050.00317.74
8.1.210.0040.00418.77
8.1.200.0070.00317.22
8.1.190.0050.00317.36
8.1.180.0000.00818.10
8.1.170.0040.00418.45
8.1.160.0030.00618.96
8.1.150.0040.00420.31
8.1.140.0000.00719.57
8.1.130.0030.00318.85
8.1.120.0030.00317.50
8.1.110.0070.00017.44
8.1.100.0080.00017.38
8.1.90.0000.00817.46
8.1.80.0000.00817.35
8.1.70.0030.00317.45
8.1.60.0040.00417.63
8.1.50.0000.00817.59
8.1.40.0030.00517.57
8.1.30.0030.00617.64
8.1.20.0070.00017.55
8.1.10.0000.00717.45
8.1.00.0040.00417.29
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0030.00318.32
8.0.270.0030.00317.13
8.0.260.0000.00716.82
8.0.250.0070.00016.98
8.0.240.0000.00816.98
8.0.230.0040.00417.00
8.0.220.0070.00016.88
8.0.210.0050.00216.93
8.0.200.0000.00716.99
8.0.190.0040.00416.87
8.0.180.0040.00416.83
8.0.170.0050.00316.80
8.0.160.0030.00616.89
8.0.150.0000.00716.91
8.0.140.0040.00416.82
8.0.130.0030.00313.31
8.0.120.0030.00516.86
8.0.110.0070.00016.89
8.0.100.0030.00616.85
8.0.90.0000.00816.73
8.0.80.0160.00016.86
8.0.70.0040.00416.92
8.0.60.0040.00416.71
8.0.50.0050.00316.91
8.0.30.0140.00417.09
8.0.20.0130.00817.40
8.0.10.0040.00416.95
8.0.00.0040.01316.89
7.4.330.0070.00015.55
7.4.320.0000.00616.52
7.4.300.0060.00016.50
7.4.290.0060.00316.50
7.4.280.0080.00016.48
7.4.270.0030.00316.60
7.4.260.0030.00316.58
7.4.250.0000.00716.57
7.4.240.0000.00716.43
7.4.230.0030.00516.53
7.4.220.0100.01616.60
7.4.210.0060.00916.61
7.4.200.0040.00416.30
7.4.160.0120.01216.35
7.4.150.0090.01717.40
7.4.140.0110.01017.86
7.4.130.0140.00716.66
7.4.120.0140.00816.42
7.4.110.0000.01716.44
7.4.100.0100.01016.55
7.4.90.0070.01116.40
7.4.80.0090.00919.39
7.4.70.0080.00816.43
7.4.60.0130.00316.44
7.4.50.0060.00916.56
7.4.40.0070.01016.55
7.4.30.0130.00316.38
7.4.10.0150.00315.19
7.4.00.0090.00815.00
7.3.330.0000.00613.17
7.3.320.0000.00613.13
7.3.310.0080.00016.43
7.3.300.0030.00316.22
7.3.290.0070.00816.32
7.3.280.0080.01016.35
7.3.270.0150.00617.40
7.3.260.0120.00716.27
7.3.250.0100.00816.37
7.3.240.0100.01216.31
7.3.230.0150.00916.34
7.3.210.0100.01016.27
7.3.200.0110.00616.31
7.3.190.0090.01316.27
7.3.180.0100.00616.24
7.3.170.0070.01016.44
7.3.160.0060.01116.39
7.3.130.0120.00415.08
7.3.120.0060.01014.81
7.3.110.0130.00614.71
7.3.100.0050.00714.68
7.3.90.0040.01414.79
7.3.80.0100.00514.86
7.3.70.0030.01314.71
7.3.60.0050.00914.72
7.3.50.0070.00514.55
7.3.40.0020.01214.85
7.3.30.0040.00814.67
7.3.20.0090.00716.62
7.3.10.0090.00516.56
7.3.00.0080.00416.58
7.2.330.0090.00916.74
7.2.320.0070.01316.48
7.2.310.0130.01016.52
7.2.300.0100.00716.43
7.2.290.0070.01016.54
7.2.260.0090.00915.17
7.2.250.0110.00814.82
7.2.240.0050.00714.91
7.2.230.0060.01114.87
7.2.220.0030.01015.14
7.2.210.0030.01315.06
7.2.200.0030.01114.88
7.2.190.0000.01314.92
7.2.180.0050.01015.04
7.2.170.0080.00714.93
7.2.160.0060.00614.97
7.2.150.0000.01216.91
7.2.140.0040.00716.86
7.2.130.0080.00716.87
7.2.120.0080.00716.86
7.2.110.0050.00916.85
7.2.100.0090.00616.84
7.2.90.0040.00916.85
7.2.80.0040.01016.90
7.2.70.0050.01216.61
7.2.60.0080.00716.72
7.2.50.0030.00916.88
7.2.40.0100.00816.83
7.2.30.0010.01216.84
7.2.20.0110.00217.04
7.2.10.0050.01016.74
7.2.00.0030.01016.88
7.1.330.0110.00515.79
7.1.320.0100.00415.92
7.1.310.0080.00515.87
7.1.300.0060.00715.91
7.1.290.0070.00715.67
7.1.280.0050.01015.78
7.1.270.0050.00915.72
7.1.260.0060.00615.75
7.1.250.0020.01315.75
7.1.240.0110.00315.54
7.1.230.0000.01315.79
7.1.220.0000.01315.75
7.1.210.0000.01215.80
7.1.200.0060.00315.95
7.1.190.0110.00415.88
7.1.180.0130.00316.06
7.1.170.0070.01015.86
7.1.160.0160.00315.93
7.1.150.0060.00915.51
7.1.140.0000.01315.86
7.1.130.0060.00615.75
7.1.120.0030.00615.83
7.1.110.0090.00615.52
7.1.100.0030.00615.61
7.1.90.0060.00615.83
7.1.80.0110.00316.00
7.1.70.0040.00616.46
7.1.60.0620.01224.46
7.1.50.0520.01424.32
7.1.40.0620.00724.26
7.1.30.1270.01024.01
7.1.20.0770.01024.15
7.1.10.0720.01315.51
7.1.00.0560.01015.39
7.0.330.0060.00615.45
7.0.320.0030.00815.46
7.0.310.0060.00915.22
7.0.300.0060.00915.46
7.0.290.0030.00915.61
7.0.280.0070.00715.14
7.0.270.0040.00415.17
7.0.260.0070.00715.30
7.0.250.0030.00915.35
7.0.240.0110.00015.39
7.0.230.0050.00515.38
7.0.220.0120.00315.22
7.0.210.0060.00615.16
7.0.200.0720.00515.15
7.0.190.0710.00915.25
7.0.180.0590.00515.01
7.0.170.1400.01114.81
7.0.160.0900.00814.88
7.0.150.0570.01114.96
7.0.140.1050.00715.02
7.0.130.0620.01014.88
7.0.120.0650.01015.17
7.0.110.0580.01214.96
7.0.100.0620.00415.02
7.0.90.0570.01214.94
7.0.80.0500.00714.83
7.0.70.0450.01214.85
7.0.60.0480.00814.89
7.0.50.0600.01015.14
7.0.40.0530.00814.02
7.0.30.0550.00714.18
7.0.20.0520.01214.11
7.0.10.0860.01114.01
7.0.00.0770.00613.90
5.6.400.0060.00614.63
5.6.390.0030.00614.25
5.6.380.0030.00614.41
5.6.370.0060.00814.47
5.6.360.0060.00914.11
5.6.350.0000.01414.62
5.6.340.0090.00014.13
5.6.330.0000.01114.29
5.6.320.0100.00614.59
5.6.310.0040.00714.73
5.6.300.0000.01014.02
5.6.290.0030.01314.67
5.6.280.0060.01214.21
5.6.270.0000.00914.65
5.6.260.0000.01514.53
5.6.250.0060.00614.23
5.6.240.0100.00614.49
5.6.230.0080.00814.14
5.6.220.0000.01814.52
5.6.210.0090.00314.25
5.6.200.0090.00314.46
5.6.190.0070.00714.62
5.6.180.0090.00014.60
5.6.170.0030.01014.32
5.6.160.0070.00414.43
5.6.150.0030.00614.68
5.6.140.0030.01014.47
5.6.130.0000.00814.61
5.6.120.0000.01114.32
5.6.110.0070.01014.37
5.6.100.0000.01214.35
5.6.90.0030.01314.33
5.6.80.0120.00314.34
5.6.70.0060.00614.34
5.6.60.0100.00714.27
5.6.50.0080.00614.43
5.6.40.0080.00013.94
5.6.30.0090.00614.45
5.6.20.0000.00814.68
5.6.10.0030.01014.21
5.6.00.0000.00914.20

preferences:
65.5 ms | 400 KiB | 5 Q