3v4l.org

run code in 300+ PHP versions simultaneously
<?php $j = <<<EOD [{"id": 1, "product": {"id": 1, "brand": {"id": 1, "name": "iphone"}}, "provider": {"id": 1, "name": "at&t"}}, {"id": 2, "product": {"id": 2, "brand": {"id": 2, "name": "iphone"}}, "provider": {"id": 1, "name": "at&t"}}, {"id": 3, "product": {"id": 3, "brand": {"id": 3, "name": "iphone"}}, "provider": {"id": 1, "name": "t-mobile"}}] EOD; $items = json_decode($j); $tm = array(); foreach ($items as $item) { $product = $item->product->brand->name; $provider = $item->provider->name; $tm[$provider][$product] = ($tm[$provider][$product] ?? 0) + 1; } print_r($tm);

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.5.00.0150.00720.07
8.4.150.0000.00114.05
8.4.140.0160.00617.40
8.4.130.0110.00917.55
8.4.120.0130.00620.51
8.4.110.0060.00320.82
8.4.100.0100.01217.58
8.4.90.0170.00417.46
8.4.80.0070.00317.82
8.4.70.0050.00617.63
8.4.60.0100.00718.45
8.4.50.0110.00817.93
8.4.40.0150.00617.54
8.4.30.0030.01619.01
8.4.20.0110.00822.52
8.4.10.0060.00323.83
8.3.280.0130.00718.57
8.3.270.0100.01016.34
8.3.260.0120.00916.52
8.3.250.0130.00518.71
8.3.240.0140.00616.74
8.3.230.0140.00516.59
8.3.220.0100.01020.91
8.3.210.0050.00316.94
8.3.200.0050.00416.59
8.3.190.0080.01217.21
8.3.180.0090.00616.66
8.3.170.0090.00918.99
8.3.160.0140.00418.27
8.3.150.0120.00617.09
8.3.140.0110.00720.75
8.3.130.0080.00018.11
8.3.120.0040.00718.78
8.3.110.0060.00320.94
8.3.100.0030.00924.06
8.3.90.0040.00426.77
8.3.80.0110.00016.50
8.3.70.0090.00916.75
8.3.60.0070.00716.75
8.3.50.0110.00420.18
8.3.40.0070.00720.16
8.3.30.0030.01218.75
8.3.20.0040.00424.18
8.3.10.0040.00424.66
8.3.00.0040.00426.16
8.2.290.0130.00720.48
8.2.280.0100.00918.62
8.2.270.0120.00616.87
8.2.260.0080.00018.82
8.2.250.0060.01618.48
8.2.240.0000.00817.28
8.2.230.0040.00422.58
8.2.220.0030.00637.54
8.2.210.0050.00326.77
8.2.200.0060.00618.16
8.2.190.0100.00716.58
8.2.180.0090.01325.92
8.2.170.0120.00318.83
8.2.160.0100.01022.96
8.2.150.0000.00825.66
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0040.00420.64
8.2.110.0000.00922.25
8.2.100.0110.00017.72
8.2.90.0000.01019.11
8.2.80.0000.00817.97
8.2.70.0050.00317.63
8.2.60.0050.00317.91
8.2.50.0040.00418.07
8.2.40.0090.00318.22
8.2.30.0040.00418.11
8.2.20.0080.00019.30
8.2.10.0040.00418.13
8.2.00.0000.00719.36
8.1.330.0130.00522.02
8.1.320.0100.00916.08
8.1.310.0060.00316.59
8.1.300.0000.00818.37
8.1.290.0030.00730.84
8.1.280.0030.01425.92
8.1.270.0040.00424.66
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0060.00323.82
8.1.230.0070.00420.85
8.1.220.0060.00317.78
8.1.210.0000.00818.77
8.1.200.0040.00417.35
8.1.190.0000.00817.23
8.1.180.0030.00618.10
8.1.170.0080.00018.64
8.1.160.0050.00318.88
8.1.150.0050.00318.64
8.1.140.0000.00817.33
8.1.130.0040.00418.84
8.1.120.0000.00817.48
8.1.110.0000.00717.39
8.1.100.0130.00317.31
8.1.90.0080.00817.37
8.1.80.0150.00017.35
8.1.70.0050.01017.38
8.1.60.0140.00417.41
8.1.50.0160.00317.41
8.1.40.0180.00017.55
8.1.30.0180.00017.66
8.1.20.0000.01817.63
8.1.10.0070.01017.44
8.1.00.0120.00617.44
8.0.300.0000.00718.77
8.0.290.0050.00316.75
8.0.280.0030.00318.44
8.0.270.0080.00017.27
8.0.260.0000.00718.36
8.0.250.0000.00717.03
8.0.240.0090.00016.98
8.0.230.0120.00316.96
8.0.220.0130.00216.94
8.0.210.0060.00816.91
8.0.200.0050.01016.85
8.0.190.0130.00216.96
8.0.180.0140.00016.85
8.0.170.0110.00216.96
8.0.160.0100.00516.88
8.0.150.0130.00216.86
8.0.140.0150.00016.88
8.0.130.0110.00516.97
8.0.120.0130.00317.01
8.0.110.0120.00216.99
8.0.100.0090.00516.79
8.0.90.0080.00816.93
8.0.80.0110.00416.89
8.0.70.0060.00916.86
8.0.60.0000.01416.94
8.0.50.0110.00416.85
8.0.30.0060.00616.89
8.0.20.0080.00516.94
8.0.10.0120.00417.09
7.4.330.0020.00215.55
7.4.320.0060.01116.61
7.4.300.0050.00516.44
7.4.290.0070.00316.50
7.4.280.0050.01116.59
7.4.270.0060.01016.35
7.4.260.0100.00516.57
7.4.250.0110.00516.43
7.4.240.0150.00016.47
7.4.230.0150.00316.50
7.4.220.0140.00016.57
7.4.210.0100.00316.47
7.4.200.0130.00016.39
7.4.190.0140.00016.55
7.4.180.0120.00216.66
7.4.160.0100.00316.42
7.4.150.0070.00716.58
7.4.140.0070.00716.45
7.4.130.0110.00316.38
7.4.120.0110.00416.32
7.4.110.0090.00416.46
7.4.100.0150.00016.53
7.4.90.0140.00016.52
7.4.80.0090.00516.47
7.4.70.0000.00816.43
7.4.60.0110.00316.43
7.4.50.0100.00316.36
7.4.40.0000.01416.37
7.4.30.0100.00316.46
7.4.20.0030.01016.50
7.4.10.0100.00316.46
7.4.00.0130.00016.41

preferences:
113.81 ms | 403 KiB | 5 Q