3v4l.org

run code in 300+ PHP versions simultaneously
<?php $cats = [ ['id' => 1, 'category_style_code' => 'GA'], ['id' => 2, 'category_style_code' => 'PA'], ['id' => 3, 'category_style_code' => 'CA'], ['id' => 4, 'category_style_code' => 'MA'] ]; $prods = [ ['id' => 1, 'default_price' => 37.50, 'category_code' => 'MA'], ['id' => 2, 'default_price' => 36.50, 'category_code' => 'GA'], ['id' => 3, 'default_price' => 38.50, 'category_code' => 'CA'], ['id' => 4, 'default_price' => 39.50, 'category_code' => 'GA'], ]; $associative_cats = array_column($cats, null, 'category_style_code'); foreach ($prods as $row) { if (isset($associative_cats[$row['category_code']])) { $associative_cats[$row['category_code']]['products'][] = $row; } } var_export(array_values($associative_cats));

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.70.0030.01318.55
8.3.60.0070.01118.55
8.3.50.0180.00321.90
8.3.40.0100.01018.84
8.3.30.0120.00318.45
8.3.20.0070.00021.94
8.3.10.0050.00220.16
8.3.00.0080.00023.48
8.2.190.0060.01216.58
8.2.180.0090.00916.63
8.2.170.0090.00622.96
8.2.160.0140.00422.07
8.2.150.0060.00324.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0070.00026.16
8.2.110.0090.00020.19
8.2.100.0050.00817.91
8.2.90.0080.00017.84
8.2.80.0080.00018.04
8.2.70.0060.00317.93
8.2.60.0030.00518.16
8.2.50.0000.00818.10
8.2.40.0040.00419.33
8.2.30.0000.00719.22
8.2.20.0040.00418.13
8.2.10.0000.00819.23
8.2.00.0030.00519.18
8.1.280.0120.00325.92
8.1.270.0080.00021.94
8.1.260.0070.00026.35
8.1.250.0080.00028.09
8.1.240.0080.00023.79
8.1.230.0070.00421.04
8.1.220.0000.00917.74
8.1.210.0150.00418.77
8.1.200.0080.00417.00
8.1.190.0050.00317.23
8.1.180.0030.00518.10
8.1.170.0000.01018.46
8.1.160.0000.00918.90
8.1.150.0060.00318.87
8.1.140.0020.00523.93
8.1.130.0030.00317.49
8.1.120.0040.00417.36
8.1.110.0030.00617.49
8.1.100.0030.00617.47
8.1.90.0030.00717.39
8.1.80.0000.00817.34
8.1.70.0000.00717.46
8.1.60.0030.00517.63
8.1.50.0030.00617.54
8.1.40.0000.00817.43
8.1.30.0030.00517.54
8.1.20.0040.00417.57
8.1.10.0030.00617.41
8.1.00.0050.00217.48
8.0.300.0060.00319.63
8.0.290.0040.00416.63
8.0.280.0040.00418.33
8.0.270.0030.00517.25
8.0.260.0050.00316.78
8.0.250.0040.00416.89
8.0.240.0030.00316.89
8.0.230.0040.00416.97
8.0.220.0030.00316.91
8.0.210.0030.00316.89
8.0.200.0030.00316.96
8.0.190.0000.00716.95
8.0.180.0030.00516.82
8.0.170.0060.00316.79
8.0.160.0040.00417.01
8.0.150.0070.00016.87
8.0.140.0050.00216.88
8.0.130.0000.00713.28
8.0.120.0040.00416.87
8.0.110.0030.00516.85
8.0.100.0000.00716.72
8.0.90.0060.00316.77
8.0.80.0070.01016.96
8.0.70.0000.00716.72
8.0.60.0070.00016.93
8.0.50.0040.00416.70
8.0.30.0100.00816.78
8.0.20.0150.00316.98
8.0.10.0050.00217.13
8.0.00.0090.01016.71
7.4.330.0000.00615.55
7.4.320.0040.00416.58
7.4.300.0030.00316.61
7.4.290.0080.00016.49
7.4.280.0040.00416.39
7.4.270.0000.00716.46
7.4.260.0000.00616.58
7.4.250.0000.00716.61
7.4.240.0040.00416.41
7.4.230.0000.00716.71
7.4.220.0040.00416.64
7.4.210.0060.01016.50
7.4.200.0000.00716.45
7.4.130.0140.00316.55
7.4.120.0160.00616.48
7.4.110.0100.00616.39
7.4.100.0070.00716.52
7.4.90.0030.01916.48
7.4.80.0090.01319.39
7.4.70.0090.00916.61
7.4.60.0070.01016.31
7.4.50.0000.01516.57
7.4.40.0090.00616.46
7.4.00.0080.00915.00
7.3.330.0000.00613.18
7.3.320.0000.00513.23
7.3.310.0030.00316.20
7.3.300.0000.00716.37
7.3.290.0030.00316.33
7.3.280.0060.00916.35
7.3.260.0110.00716.34
7.3.230.0140.00816.29
7.3.210.0120.00616.24
7.3.200.0100.00716.58
7.3.190.0030.01316.48
7.3.180.0100.00516.63
7.3.170.0040.01516.55
7.3.160.0120.00316.42
7.3.120.0100.00714.75
7.3.110.0070.01014.74
7.3.100.0030.01214.80
7.3.90.0100.00614.89
7.3.80.0000.01414.86
7.3.70.0100.00314.91
7.3.60.0110.00714.88
7.3.50.0110.00414.93
7.3.40.0050.01314.82
7.3.30.0120.00314.63
7.3.20.0080.01116.57
7.3.10.0070.01116.85
7.3.00.0040.01216.76
7.2.330.0090.00916.77
7.2.320.0060.01016.65
7.2.310.0120.00616.59
7.2.300.0170.00416.76
7.2.290.0030.01616.75
7.2.250.0070.01115.28
7.2.240.0070.01115.14
7.2.230.0090.00615.07
7.2.220.0070.01115.05
7.2.210.0140.00014.75
7.2.200.0070.00415.04
7.2.190.0030.01115.02
7.2.180.0060.00815.18
7.2.170.0050.00815.07
7.2.160.0130.00414.94
7.2.150.0110.00816.74
7.2.140.0080.01217.07
7.2.130.0090.00416.89
7.2.120.0050.00916.94
7.2.110.0060.00816.81
7.2.100.0080.00816.69
7.2.90.0060.00816.90
7.2.80.0070.01116.94
7.2.70.0050.01216.77
7.2.60.0060.00916.52
7.2.50.0090.00416.96
7.2.40.0070.00716.91
7.2.30.0130.00116.84
7.2.20.0110.00616.84
7.2.10.0080.00717.04
7.2.00.0090.00617.10
7.1.330.0080.00815.68
7.1.320.0090.00915.76
7.1.310.0030.01015.85
7.1.300.0120.00515.71
7.1.290.0090.00515.86
7.1.280.0080.00315.76
7.1.270.0070.00715.74
7.1.260.0060.00715.75
7.1.250.0110.00415.81
7.1.240.0000.01215.94
7.1.230.0030.01015.96
7.1.220.0000.01515.83
7.1.210.0060.00315.77
7.1.200.0070.00715.65
7.1.190.0040.01015.65
7.1.180.0070.00315.78
7.1.170.0090.00415.81
7.1.160.0000.00815.96
7.1.150.0060.00915.83
7.1.140.0040.00415.95
7.1.130.0100.01015.99
7.1.120.0080.00315.91
7.1.110.0070.01315.64
7.1.100.0040.00415.94
7.1.90.0000.01115.83
7.1.80.0100.00615.65
7.1.70.0040.00815.74
7.1.60.0040.01115.81
7.1.50.0090.00615.82
7.1.40.0090.00915.83
7.1.30.0100.00715.66
7.1.20.0040.01515.59
7.1.10.0090.00615.66
7.1.00.0000.01915.97

preferences:
19.74 ms | 401 KiB | 5 Q