3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arrays = [ [ "id" => 1, "order_id" => 1, "image_url" => "/resources/filename1" ], [ "id" => 2, "order_id" => 1, "image_url" => "/resources/filename2" ], [ "id" => 3, "order_id" => 1, "image_url" => "/resources/filename3" ], [ "id" => 4, "order_id" => 2, "image_url" => "/resources/filename4" ], ]; foreach($arrays as $array) { if(!isset($result[$array['order_id']]['id'])) { $result[$array['order_id']]['id']=$array['id']; } $result[$array['order_id']]['order_id']=$array['order_id']; $result[$array['order_id']]['image_url'][]=$array['image_url']; } print_r($result);

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.0180.00517.50
8.4.130.0130.00818.64
8.4.120.0100.01124.14
8.4.110.0120.00717.92
8.4.100.0130.00719.01
8.4.90.0100.00820.59
8.4.80.0130.00720.49
8.4.70.0080.00818.18
8.4.60.0080.00318.93
8.4.50.0130.00718.39
8.4.40.0100.00717.76
8.4.30.0100.01017.41
8.4.20.0140.00319.45
8.4.10.0130.00717.77
8.3.270.0150.00616.67
8.3.260.0100.01016.57
8.3.250.0120.00319.17
8.3.240.0110.00817.07
8.3.230.0110.00316.45
8.3.220.0060.00219.03
8.3.210.0110.00816.66
8.3.200.0160.00316.73
8.3.190.0110.01019.16
8.3.180.0090.00616.36
8.3.170.0090.00920.93
8.3.160.0120.00617.12
8.3.150.0110.00718.58
8.3.140.0050.00317.45
8.3.130.0000.00818.57
8.3.120.0000.00818.93
8.3.110.0090.00916.63
8.3.100.0030.00724.06
8.3.90.0130.00626.77
8.3.80.0090.00018.43
8.3.70.0120.00918.25
8.3.60.0130.00616.38
8.3.50.0130.00517.35
8.3.40.0220.00018.79
8.3.30.0110.00318.75
8.3.20.0000.00719.11
8.3.10.0040.00421.03
8.3.00.0000.00817.91
8.2.290.0120.00920.61
8.2.280.0030.00618.37
8.2.270.0110.00819.09
8.2.260.0080.00016.86
8.2.250.0040.00416.59
8.2.240.0030.00617.41
8.2.230.0100.01020.94
8.2.220.0050.00337.54
8.2.210.0040.00426.77
8.2.200.0040.00816.75
8.2.190.0090.00616.58
8.2.180.0110.01118.13
8.2.170.0110.00322.96
8.2.160.0070.01120.76
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0040.00419.83
8.2.120.0070.00026.35
8.2.110.0110.01122.25
8.2.100.0000.01117.79
8.2.90.0080.00017.88
8.2.80.0060.00318.75
8.2.70.0030.00617.75
8.2.60.0000.00817.63
8.2.50.0040.00417.55
8.2.40.0040.00421.20
8.2.30.0000.00719.41
8.2.20.0000.00818.04
8.2.10.0000.00718.06
8.2.00.0000.00719.43
8.1.330.0080.01021.98
8.1.320.0140.00615.97
8.1.310.0000.00818.12
8.1.300.0080.00016.34
8.1.290.0060.00630.84
8.1.280.0150.00025.92
8.1.270.0000.00924.02
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0080.00023.92
8.1.230.0070.00420.94
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0000.00917.25
8.1.190.0040.00417.35
8.1.180.0000.00818.10
8.1.170.0050.00318.50
8.1.160.0070.00018.90
8.1.150.0000.00818.89
8.1.140.0040.00417.62
8.1.130.0000.00719.06
8.1.120.0040.00717.46
8.1.110.0040.00417.37
8.1.100.0000.00717.45
8.1.90.0040.00417.48
8.1.80.0000.00717.43
8.1.70.0070.00017.45
8.1.60.0030.00617.57
8.1.50.0030.00517.54
8.1.40.0050.00317.42
8.1.30.0000.00817.68
8.1.20.0050.00217.49
8.1.10.0040.00417.48
8.1.00.0030.00617.52
8.0.300.0000.00720.09
8.0.290.0000.00816.75
8.0.280.0000.00718.45
8.0.270.0030.00317.18
8.0.260.0000.00617.18
8.0.250.0070.00016.86
8.0.240.0030.00516.98
8.0.230.0000.00716.86
8.0.220.0030.00316.98
8.0.210.0000.00816.93
8.0.200.0060.00016.85
8.0.190.0040.00416.97
8.0.180.0080.00017.00
8.0.170.0000.00816.81
8.0.160.0000.00716.85
8.0.150.0040.00416.84
8.0.140.0050.00216.92
8.0.130.0000.00513.27
8.0.120.0040.00416.83
8.0.110.0040.00416.96
8.0.100.0000.00716.80
8.0.90.0040.00416.77
8.0.80.0140.00716.85
8.0.70.0040.00416.74
8.0.60.0000.00716.84
8.0.50.0030.00516.79
8.0.30.0160.00316.92
8.0.20.0130.00717.40
8.0.10.0040.00416.91
8.0.00.0100.00816.73
7.4.330.0000.00515.55
7.4.320.0030.00316.70
7.4.300.0060.00016.60
7.4.290.0030.00316.65
7.4.280.0040.00416.62
7.4.270.0040.00416.42
7.4.260.0040.00716.52
7.4.250.0000.00716.40
7.4.240.0040.00416.54
7.4.230.0000.00716.41
7.4.220.0050.00316.46
7.4.210.0100.00416.57
7.4.200.0000.00716.35
7.4.160.0080.00716.52
7.4.140.0100.00917.86
7.4.130.0070.01116.48
7.4.120.0080.00916.52
7.4.110.0140.00316.53
7.4.100.0100.01016.40
7.4.90.0060.01216.40
7.4.80.0130.00319.39
7.4.70.0140.00316.47
7.4.60.0110.01116.50
7.4.50.0090.00616.21
7.4.40.0110.01116.74
7.4.00.0050.01014.93
7.3.330.0000.00613.17
7.3.320.0000.00613.24
7.3.310.0070.00016.35
7.3.300.0030.00316.30
7.3.290.0000.00816.24
7.3.280.0100.00516.26
7.3.260.0130.00716.40
7.3.240.0080.00916.60
7.3.230.0030.01416.51
7.3.210.0050.01416.63
7.3.200.0160.00316.23
7.3.190.0080.00816.22
7.3.180.0070.01316.50
7.3.170.0090.00616.64
7.3.160.0120.00416.34
7.3.120.0030.01515.07
7.3.110.0070.01115.14
7.3.100.0110.00414.86
7.3.90.0000.01114.80
7.3.80.0060.00915.07
7.3.70.0060.00314.55
7.3.60.0080.00814.89
7.3.50.0070.01414.71
7.3.40.0070.00314.96
7.3.30.0110.00414.55
7.3.20.0090.00616.76
7.3.10.0090.00616.82
7.3.00.0070.00316.61
7.2.330.0100.01016.74
7.2.320.0090.00916.43
7.2.310.0120.00616.69
7.2.300.0090.00916.68
7.2.290.0170.00716.38
7.2.250.0030.01314.96
7.2.240.0110.00715.08
7.2.230.0100.00715.28
7.2.220.0100.00615.25
7.2.210.0060.01314.96
7.2.200.0070.01014.95
7.2.190.0060.00914.95
7.2.180.0030.01015.06
7.2.170.0000.00915.20
7.2.60.7120.00714.59
7.2.50.8290.01114.69
7.2.40.8790.01215.03
7.2.30.5600.00915.00
7.2.20.7380.01414.87
7.2.10.6690.00814.98
7.2.00.7760.00515.36
7.1.330.0070.00715.86
7.1.320.0060.00615.99
7.1.310.0060.00915.97
7.1.300.0070.01015.85
7.1.290.0000.00915.57
7.1.280.0100.01015.68
7.1.270.0040.01115.91
7.1.260.0140.00315.84
7.1.200.0000.01116.00
7.1.170.6490.00713.72
7.1.160.7440.00916.47
7.1.150.6680.01016.03
7.1.140.6480.01516.44
7.1.130.6640.01216.36
7.1.120.6950.01116.42
7.1.110.8060.01115.83
7.1.100.7070.00815.72
7.1.90.7290.01316.13
7.1.80.8310.01315.73
7.1.70.8290.00715.45
7.1.60.5960.01733.30
7.1.51.5160.01732.89
7.1.40.4140.01132.51
7.1.31.3750.00932.65
7.1.21.1810.01732.91
7.1.11.1170.00914.71
7.1.00.6810.01614.90

preferences:
31.66 ms | 403 KiB | 5 Q