3v4l.org

run code in 300+ PHP versions simultaneously
<?php $product_details = [ "0" => [ "brand_id" => 1, "product_type" => 1, ], "1" => [ "brand_id" => 2, "product_type" => 1, ], "2" => [ "brand_id" => 1, "product_type" => 1, ], "3" => [ "brand_id" => 2, "product_type" => 1, ], ]; function sortByOrder($a, $b) { return $a['brand_id'] - $b['brand_id']; } usort($product_details, 'sortByOrder'); $result = []; foreach ($product_details as $key => $value) { $result['brand_id'.$value['brand_id']][] = $value; } extract($result); print_r($brand_id1); print_r($brand_id2);

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.10.0110.00716.73
8.5.00.0150.00819.86
8.4.150.0030.00014.05
8.4.140.0120.00917.79
8.4.130.0050.00318.77
8.4.120.0090.00924.31
8.4.110.0080.01122.39
8.4.100.0060.00317.66
8.4.90.0120.00818.83
8.4.80.0130.00617.79
8.4.70.0040.00518.03
8.4.60.0130.00820.86
8.4.50.0100.00818.75
8.4.40.0100.01020.53
8.4.30.0060.01324.25
8.4.20.0080.01118.71
8.4.10.0000.00919.55
8.3.280.0130.00718.49
8.3.270.0130.00916.47
8.3.260.0130.00616.86
8.3.250.0050.00519.11
8.3.240.0110.00516.75
8.3.230.0130.00716.68
8.3.220.0060.00317.38
8.3.210.0090.01018.71
8.3.200.0060.00316.88
8.3.190.0150.00417.22
8.3.180.0110.00716.57
8.3.170.0060.01317.06
8.3.160.0130.00620.30
8.3.150.0040.00417.28
8.3.140.0040.01117.36
8.3.130.0080.00016.82
8.3.120.0100.00018.85
8.3.110.0110.00016.75
8.3.100.0000.00816.60
8.3.90.0080.00018.42
8.3.80.0060.00318.55
8.3.70.0110.00316.50
8.3.60.0160.00618.27
8.3.50.0100.01121.05
8.3.40.0070.00718.67
8.3.30.0070.00718.76
8.3.20.0040.00422.07
8.3.10.0040.00420.21
8.3.00.0000.00823.70
8.2.290.0040.00620.40
8.2.280.0100.00918.78
8.2.270.0090.00917.18
8.2.260.0000.00816.79
8.2.250.0000.00817.04
8.2.240.0040.00717.21
8.2.230.0060.00320.94
8.2.220.0040.00424.06
8.2.210.0120.00326.77
8.2.200.0090.00018.42
8.2.190.0070.00716.75
8.2.180.0180.00416.62
8.2.170.0140.00722.96
8.2.160.0080.00820.95
8.2.150.0090.00024.18
8.2.140.0070.00024.66
8.2.130.0040.00426.16
8.2.120.0080.00026.16
8.2.110.0030.00719.34
8.2.100.0090.00318.03
8.2.90.0090.00019.21
8.2.80.0100.00517.97
8.2.70.0060.00317.38
8.2.60.0060.00317.93
8.2.50.0080.00018.14
8.2.40.0040.00420.59
8.2.30.0000.00818.01
8.2.20.0040.00418.13
8.2.10.0070.00019.39
8.2.00.0060.00619.32
8.1.330.0100.01022.07
8.1.320.0140.00516.27
8.1.310.0090.00618.71
8.1.300.0060.00320.24
8.1.290.0040.00818.88
8.1.280.0090.00925.92
8.1.270.0040.00424.04
8.1.260.0070.00026.35
8.1.250.0050.00328.09
8.1.240.0090.00023.92
8.1.230.0070.00417.82
8.1.220.0000.00817.74
8.1.210.0060.00318.77
8.1.200.0090.00017.23
8.1.190.0060.00317.13
8.1.180.0040.00418.10
8.1.170.0000.00818.64
8.1.160.0000.00718.91
8.1.150.0040.00418.95
8.1.140.0040.00418.91
8.1.130.0000.00719.34
8.1.120.0040.00417.49
8.1.110.0000.00917.50
8.1.100.0000.00717.39
8.1.90.0110.00017.46
8.1.80.0040.00417.48
8.1.70.0000.00717.51
8.1.60.0000.00817.55
8.1.50.0000.00717.48
8.1.40.0000.00717.56
8.1.30.0040.00417.55
8.1.20.0040.00417.68
8.1.10.0000.00817.63
8.1.00.0000.00717.38
8.0.300.0060.00318.77
8.0.290.0040.00416.75
8.0.280.0000.00718.56
8.0.270.0000.00716.89
8.0.260.0090.00016.89
8.0.250.0000.00716.89
8.0.240.0000.00716.91
8.0.230.0000.00717.04
8.0.220.0040.00416.86
8.0.210.0040.00417.00
8.0.200.0030.00316.92
8.0.190.0040.00416.85
8.0.180.0040.00416.87
8.0.170.0000.00816.95
8.0.160.0040.00416.86
8.0.150.0000.00816.83
8.0.140.0040.00316.72
8.0.130.0000.00513.30
8.0.120.0050.00316.92
8.0.110.0000.00716.81
8.0.100.0040.00416.88
8.0.90.0000.00916.86
8.0.80.0060.01616.93
8.0.70.0040.00416.96
8.0.60.0040.00416.69
8.0.50.0030.00516.87
8.0.30.0080.01117.11
8.0.20.0070.01216.94
8.0.10.0000.00817.01
8.0.00.0130.00716.82
7.4.330.0000.00615.55
7.4.320.0060.00016.60
7.4.300.0030.00316.52
7.4.290.0040.00416.52
7.4.280.0040.00416.61
7.4.270.0070.00016.62
7.4.260.0030.00316.59
7.4.250.0070.00016.48
7.4.240.0040.00416.62
7.4.230.0030.00316.41
7.4.220.0030.00316.49
7.4.210.0100.00816.59
7.4.200.0030.00316.51
7.4.130.0090.00916.51
7.4.120.0170.00616.60
7.4.110.0100.00716.59
7.4.100.0080.00816.55
7.4.90.0130.00316.46
7.4.80.0250.01019.39
7.4.70.0030.01316.51
7.4.60.0100.00716.46
7.4.50.0120.00316.64
7.4.40.0120.00416.52
7.4.10.0060.00616.41
7.4.00.0060.01215.58
7.3.330.0000.00513.22
7.3.320.0060.00013.30
7.3.310.0070.00016.18
7.3.300.0000.00716.23
7.3.290.0070.00016.37
7.3.280.0120.00316.24
7.3.260.0090.00916.56
7.3.230.0130.00316.34
7.3.210.0110.00716.25
7.3.200.0090.00716.27
7.3.190.0120.00416.56
7.3.180.0060.00916.35
7.3.170.0090.00616.33
7.3.160.0150.01016.42
7.3.130.0100.01016.38
7.3.120.0110.00616.43
7.3.110.0030.01316.52
7.3.100.0090.00916.47
7.3.90.0060.00616.41
7.3.80.0030.00916.29
7.3.70.0030.01015.62
7.3.60.0080.00315.56
7.3.50.0120.00415.55
7.3.40.0070.01015.55
7.3.30.0060.00815.61
7.3.20.0060.00916.60
7.3.10.0130.00616.49
7.3.00.0130.00616.65
7.2.330.0130.00616.48
7.2.320.0120.00516.62
7.2.310.0150.00316.66
7.2.300.0060.01116.58
7.2.290.0090.00916.48
7.2.260.0110.01116.82
7.2.250.0030.01716.60
7.2.240.0120.00316.59
7.2.230.0090.00916.48
7.2.220.0030.00916.57
7.2.210.0030.01216.78
7.2.200.0050.00915.74
7.2.190.0070.00715.77
7.2.180.0090.00215.69
7.2.170.0100.00315.68
7.2.160.0020.00915.77
7.2.150.0100.00516.81
7.2.140.0040.01116.79
7.2.130.0100.01016.80
7.2.120.0070.00516.69
7.2.110.0480.00716.76
7.2.100.0060.01016.77
7.2.90.0070.01316.93
7.2.80.0090.01116.84
7.2.70.0120.00716.77
7.2.60.0100.00616.78
7.2.50.0040.01216.80
7.2.40.0070.00716.91
7.2.30.0130.01116.93
7.2.20.0060.01316.66
7.2.10.0200.00516.76
7.2.00.0050.01016.70
7.1.330.0060.00617.69
7.1.320.0030.00717.34
7.1.310.0070.00717.42
7.1.300.0120.00415.63
7.1.290.0090.00415.65
7.1.280.0050.01015.73
7.1.270.0000.01115.61
7.1.260.0110.00815.66
7.1.250.0020.00915.77
7.1.240.0000.01117.34
7.1.230.0030.01217.53
7.1.220.0070.00717.26
7.1.210.0110.00017.27
7.1.200.0070.00717.19
7.1.190.0000.01617.46
7.1.180.0080.00317.43
7.1.170.0000.01417.36
7.1.160.0120.00017.33
7.1.150.0030.00617.34
7.1.140.0060.01217.35
7.1.130.0100.00317.34
7.1.120.0000.01117.22
7.1.110.0000.01217.43
7.1.100.0070.00717.28
7.1.90.0000.01017.58
7.1.80.0070.00717.34
7.1.70.0000.01017.49
7.1.60.0060.00617.30
7.1.50.0060.00917.32
7.1.40.0060.00617.63
7.1.30.0060.00617.41
7.1.20.0070.00717.31
7.1.10.0030.00717.36
7.1.00.0030.00717.25

preferences:
37.24 ms | 403 KiB | 5 Q