3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 'relation' => 'AND', [ 'taxonomy' => 'merk', 'field' => 'slug', 'terms' => ['coral'] ], [ 'taxonomy' => 'foo', 'field' => 'bar', 'terms' => ['stackoverflow'] ], [ 'taxonomy' => 'merk', 'field' => 'slug', 'terms' => ['deluxe', 'ultra'] ] ]; foreach ($array as $key => &$item) { if (is_array($item) && isset($item['taxonomy'], $item['field'])) { $id = $item['taxonomy'] . '_' . $item['field']; if (!isset($ref[$id])) { $ref[$id] = &$item['terms']; } else { array_push($ref[$id], ...$item['terms']); unset($array[$key]); } } } var_export($array);

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.4.140.0140.00717.77
8.4.130.0120.00917.75
8.4.120.0110.00922.00
8.4.110.0110.00922.58
8.4.100.0130.00917.80
8.4.90.0100.00817.56
8.4.80.0130.00817.92
8.4.70.0030.00517.68
8.4.60.0130.00717.77
8.4.50.0070.01419.50
8.4.40.0090.00620.57
8.4.30.0150.00423.90
8.4.20.0100.01019.63
8.4.10.0040.01522.05
8.3.270.0120.00816.56
8.3.260.0110.00816.61
8.3.250.0090.01019.12
8.3.240.0120.00616.54
8.3.230.0110.00116.80
8.3.220.0070.00217.24
8.3.210.0100.00416.64
8.3.200.0120.00716.49
8.3.190.0080.00717.20
8.3.180.0060.00516.38
8.3.170.0090.00916.91
8.3.160.0120.00618.21
8.3.150.0080.01220.88
8.3.140.0000.01016.70
8.3.130.0030.00616.75
8.3.120.0040.00418.79
8.3.110.0030.00618.21
8.3.100.0000.00816.91
8.3.90.0040.00426.77
8.3.80.0060.00318.43
8.3.70.0090.00916.50
8.3.60.0120.00618.30
8.3.50.0070.01118.36
8.3.40.0070.01021.80
8.3.30.0090.00618.78
8.3.20.0000.00724.18
8.3.10.0080.00024.66
8.3.00.0030.00526.16
8.2.290.0100.01020.48
8.2.280.0060.00518.52
8.2.270.0040.00417.30
8.2.260.0040.00420.45
8.2.250.0060.00318.20
8.2.240.0180.00018.96
8.2.230.0080.00020.94
8.2.220.0110.00424.06
8.2.210.0080.00026.77
8.2.200.0090.00018.29
8.2.190.0030.01216.75
8.2.180.0110.00316.75
8.2.170.0040.01119.08
8.2.160.0130.00322.96
8.2.150.0060.00325.66
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0040.00419.36
8.2.110.0070.00322.25
8.2.100.0060.00618.03
8.2.90.0050.00319.21
8.2.80.0050.00318.05
8.2.70.0000.00817.63
8.2.60.0150.00517.59
8.2.50.0150.00417.25
8.2.40.0080.00817.38
8.2.30.0160.00017.63
8.2.20.0110.00517.38
8.2.10.0110.00817.63
8.2.00.0100.00717.50
8.1.330.0110.00816.80
8.1.320.0100.00916.05
8.1.310.0150.00018.63
8.1.300.0060.01316.20
8.1.290.0030.00630.84
8.1.280.0110.00425.92
8.1.270.0040.00424.66
8.1.260.0020.00526.35
8.1.250.0030.00528.09
8.1.240.0100.00022.03
8.1.230.0120.00019.48
8.1.220.0040.00417.79
8.1.210.0030.00618.77
8.1.200.0030.00617.35
8.1.190.0030.00617.25
8.1.180.0140.00317.25
8.1.170.0060.01216.84
8.1.160.0110.00817.25
8.1.150.0170.00217.25
8.1.140.0130.00416.97
8.1.130.0180.00017.34
8.1.120.0120.00817.25
8.1.110.0200.00017.25
8.1.100.0190.00317.38
8.1.90.0160.00317.25
8.1.80.0100.00716.88
8.1.70.0100.00717.09
8.1.60.0140.00417.23
8.1.50.0110.00717.34
8.1.40.0090.00917.60
8.1.30.0140.00517.38
8.1.20.0000.01817.23
8.1.10.0150.00417.25
8.1.00.0150.00816.88
8.0.300.0000.00918.77
8.0.290.0040.00416.75
8.0.280.0080.00816.52
8.0.270.0100.01016.52
8.0.260.0150.00416.52
8.0.250.0150.00316.52
8.0.240.0170.00016.63
8.0.230.0120.00616.75
8.0.220.0090.00916.59
8.0.210.0130.00316.52
8.0.200.0110.00716.52
8.0.190.0120.00516.52
8.0.180.0080.01016.75
8.0.170.0170.00016.52
8.0.160.0110.00616.52
8.0.150.0120.00416.52
8.0.140.0120.00416.52
8.0.130.0150.00316.63
8.0.120.0150.00216.61
8.0.110.0180.00016.52
8.0.100.0140.00316.52
8.0.90.0040.01316.52
8.0.80.0100.00716.60
8.0.70.0130.00316.52
8.0.60.0150.00316.52
8.0.50.0160.00016.52
8.0.30.0160.00316.52
8.0.20.0100.00716.52
8.0.10.0160.00016.63

preferences:
29.32 ms | 403 KiB | 5 Q