3v4l.org

run code in 300+ PHP versions simultaneously
<?php $records = [ 'h', 1, 2, 3, 4, 'f', 'h', 1, 2, 'f', 'h', 1, 2, 3, 'f', 'h', 1, 2, 3, 4, 'f', 'h', 1, 'f' ]; $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.0090.00918.55
8.3.50.0070.00716.75
8.3.40.0090.01318.67
8.3.30.0040.01118.54
8.3.20.0040.00421.87
8.3.10.0030.00523.48
8.3.00.0080.00017.90
8.2.180.0090.00618.28
8.2.170.0060.01322.96
8.2.160.0100.00321.37
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00420.35
8.2.120.0000.00826.35
8.2.110.0100.01021.00
8.2.100.0090.00319.70
8.2.90.0000.00919.30
8.2.80.0000.00817.97
8.2.70.0030.00617.38
8.2.60.0000.00818.05
8.2.50.0040.00418.10
8.2.40.0030.00522.26
8.2.30.0040.00421.14
8.2.20.0030.00518.16
8.2.10.0080.00018.06
8.2.00.0070.00017.93
8.1.280.0110.00425.92
8.1.270.0160.00323.77
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0110.00022.11
8.1.230.0070.00317.52
8.1.220.0000.00817.74
8.1.210.0030.00618.77
8.1.200.0050.00517.35
8.1.190.0000.00917.35
8.1.180.0050.00318.10
8.1.170.0080.00018.51
8.1.160.0040.00418.86
8.1.150.0000.00720.27
8.1.140.0070.00019.64
8.1.130.0000.00719.01
8.1.120.0080.00017.52
8.1.110.0000.00717.45
8.1.100.0020.00517.36
8.1.90.0000.00917.46
8.1.80.0070.00017.53
8.1.70.0000.00817.41
8.1.60.0040.00417.54
8.1.50.0080.00017.41
8.1.40.0030.00517.43
8.1.30.0000.00817.73
8.1.20.0040.00417.70
8.1.10.0030.00617.54
8.1.00.0080.00017.47
8.0.300.0030.00518.77
8.0.290.0040.00416.75
8.0.280.0000.00718.45
8.0.270.0030.00516.68
8.0.260.0060.00016.74
8.0.250.0080.00016.96
8.0.240.0000.00716.94
8.0.230.0000.00716.80
8.0.220.0030.00316.91
8.0.210.0070.00016.96
8.0.200.0030.00317.00
8.0.190.0060.00316.97
8.0.180.0020.00516.98
8.0.170.0040.00416.84
8.0.160.0040.00416.89
8.0.150.0070.00016.87
8.0.140.0040.00416.75
8.0.130.0060.00013.29
8.0.120.0060.00316.91
8.0.110.0040.00416.74
8.0.100.0070.00016.96
8.0.90.0000.00716.93
8.0.80.0000.01516.95
8.0.70.0000.00716.85
8.0.60.0000.00816.70
8.0.50.0040.00416.79
8.0.30.0070.01217.21
8.0.20.0090.01017.40
8.0.10.0030.00517.07
8.0.00.0060.01216.86
7.4.330.0040.00415.55
7.4.320.0030.00316.51
7.4.300.0000.00616.66
7.4.290.0030.00316.61
7.4.280.0080.00016.64
7.4.270.0070.00016.57
7.4.260.0070.00016.59
7.4.250.0000.00716.55
7.4.240.0040.00416.57
7.4.230.0080.00016.57
7.4.220.0070.01516.51
7.4.210.0060.00916.56
7.4.200.0050.00316.64
7.4.160.0100.00816.51
7.4.150.0000.01817.40
7.4.140.0110.01317.86
7.4.130.0120.01216.53
7.4.120.0110.01016.60
7.4.110.0100.00716.44
7.4.100.0150.00316.40
7.4.90.0140.00716.35
7.4.80.0060.01119.39
7.4.70.0030.01316.49
7.4.60.0110.00716.49
7.4.50.0060.00616.56
7.4.40.0090.00916.38
7.4.30.0140.00316.54
7.4.00.0090.00714.81
7.3.330.0000.00513.08
7.3.320.0060.00013.12
7.3.310.0030.00316.40
7.3.300.0030.00316.32
7.3.290.0160.00316.30
7.3.280.0070.01016.35
7.3.270.0140.00317.40
7.3.260.0100.01016.33
7.3.250.0070.01016.43
7.3.240.0070.01316.49
7.3.230.0130.01016.46
7.3.210.0070.01016.67
7.3.200.0090.00916.30
7.3.190.0110.01116.66
7.3.180.0080.00816.25
7.3.170.0120.00416.42
7.3.160.0120.00616.59
7.3.120.0060.01014.95
7.3.110.0070.00714.82
7.3.100.0000.01214.81
7.3.90.0080.00415.08
7.3.80.0070.01014.62
7.3.70.0040.00714.48
7.3.60.0140.00014.81
7.3.50.0140.00314.83
7.3.40.0150.00314.70
7.3.30.0070.01014.89
7.3.20.0090.00616.84
7.3.10.0050.00716.60
7.3.00.0070.00916.57
7.2.330.0090.01016.91
7.2.320.0060.01316.71
7.2.310.0070.01016.36
7.2.300.0110.00716.49
7.2.290.0100.00716.38
7.2.250.0130.00314.83
7.2.240.0090.00914.62
7.2.230.0030.01215.24
7.2.220.0000.01014.77
7.2.210.0040.01514.77
7.2.200.0060.01015.07
7.2.190.0030.01315.15
7.2.180.0070.00415.11
7.2.170.0070.01114.79
7.2.130.0090.00616.85
7.2.120.0090.00616.86
7.2.110.0100.00716.98
7.2.100.0080.00416.86
7.2.90.0110.00716.59
7.2.80.0040.01116.81
7.2.70.0030.00717.06
7.2.60.0050.00916.78
7.2.50.0090.00716.95
7.2.40.0050.00516.67
7.2.30.0100.00616.91
7.2.20.0090.00316.84
7.2.10.0080.00816.61
7.2.00.0080.00616.68
7.1.330.0130.00315.95
7.1.320.0030.01015.72
7.1.310.0000.01215.86
7.1.300.0000.01615.84
7.1.290.0030.00915.95
7.1.280.0030.01315.55
7.1.270.0070.00715.83
7.1.260.0080.00415.51
7.1.250.0070.01015.92
7.1.200.0070.00415.97
7.1.70.0000.00717.13
7.1.60.0870.02033.42
7.1.50.0970.01032.98
7.1.40.0770.02032.79
7.1.30.1100.01732.57
7.1.20.0900.01732.91
7.1.10.0930.01315.00
7.1.00.0870.01314.73
7.0.200.1030.01315.05
7.0.190.1200.01015.04
7.0.180.0870.01014.69
7.0.170.1730.01714.56
7.0.160.1070.01314.55
7.0.150.1100.01314.21
7.0.140.0570.01014.56
7.0.130.0670.01014.64
7.0.120.0830.00714.77
7.0.110.0770.00314.33
7.0.100.1570.00314.49
7.0.90.0870.01014.22
7.0.80.0700.01314.43
7.0.70.0700.00714.36
7.0.60.1030.00714.33
7.0.50.0830.01314.45
7.0.40.1230.01314.58
7.0.30.0670.01314.80
7.0.20.1000.01014.55
7.0.10.1430.01314.61
7.0.00.1030.00314.64

preferences:
31.66 ms | 400 KiB | 5 Q