3v4l.org

run code in 300+ PHP versions simultaneously
<?php $majorEarning = array( array( 'user_id' => 1, 'booking_id' => 2, 'price' => 30 ), array( 'user_id' => 2, 'booking_id' => 1, 'price' => 60 ), array( 'user_id' => 2, 'booking_id' => 6, 'price' => 10 ), array( 'user_id' => 1, 'booking_id' => 4, 'price' => 50 ) ); $r = []; foreach($majorEarning as $v){ array_key_exists($v['user_id'], $r) ? ($r[$v['user_id']]['booking_data'][] = ['booking'=>$v['booking_id'],'price'=>$v['price']]) : ($r[$v['user_id']] = ['user_id' => $v['user_id'], 'booking_data' => [['booking'=>$v['booking_id'], 'price'=>$v['price']]]]); } print_r($r);

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.130.0130.00718.54
8.4.120.0130.00823.90
8.4.110.0060.00419.05
8.4.100.0130.00818.53
8.4.90.0050.00620.57
8.4.80.0040.00418.70
8.4.70.0070.00517.97
8.4.60.0030.00718.93
8.4.50.0070.00418.81
8.4.40.0130.00717.67
8.4.30.0030.00618.87
8.4.20.0040.01518.76
8.4.10.0030.00617.65
8.3.260.0120.00816.61
8.3.250.0100.00818.83
8.3.240.0130.00717.27
8.3.230.0040.00416.66
8.3.220.0030.00418.91
8.3.210.0070.01116.48
8.3.200.0040.00516.60
8.3.190.0110.00717.14
8.3.180.0110.00816.29
8.3.170.0130.00616.59
8.3.160.0120.00317.18
8.3.150.0130.00716.33
8.3.140.0060.01018.68
8.3.130.0100.00618.36
8.3.120.0080.00019.02
8.3.110.0090.00620.94
8.3.100.0040.00424.06
8.3.90.0080.00018.43
8.3.80.0040.00718.55
8.3.70.0070.00716.50
8.3.60.0100.00316.50
8.3.50.0090.00418.06
8.3.40.0110.00418.79
8.3.30.0060.00918.73
8.3.20.0040.00421.85
8.3.10.0070.00021.90
8.3.00.0080.00022.57
8.2.290.0050.00220.67
8.2.280.0050.00316.84
8.2.270.0160.00317.25
8.2.260.0000.01916.71
8.2.250.0050.00316.72
8.2.240.0060.00319.04
8.2.230.0000.00822.58
8.2.220.0160.00037.54
8.2.210.0000.00826.77
8.2.200.0090.00016.73
8.2.190.0100.00716.75
8.2.180.0070.00718.18
8.2.170.0100.00719.09
8.2.160.0070.01022.96
8.2.150.0080.00024.18
8.2.140.0070.00024.66
8.2.130.0100.00026.16
8.2.120.0040.00420.97
8.2.110.0070.00321.06
8.2.100.0080.00417.84
8.2.90.0040.00417.97
8.2.80.0000.00818.22
8.2.70.0040.00417.63
8.2.60.0100.00017.63
8.2.50.0040.00417.55
8.2.40.0070.00019.51
8.2.30.0040.00419.33
8.2.20.0000.00718.11
8.2.10.0050.00219.33
8.2.00.0000.00819.25
8.1.330.0100.00821.85
8.1.320.0110.00815.97
8.1.310.0060.01216.47
8.1.300.0100.00020.34
8.1.290.0080.00318.88
8.1.280.0000.01725.92
8.1.270.0160.00320.41
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0090.00023.83
8.1.230.0090.00322.70
8.1.220.0060.00317.79
8.1.210.0040.00718.77
8.1.200.0000.00817.48
8.1.190.0030.00517.36
8.1.180.0000.00918.10
8.1.170.0000.00818.68
8.1.160.0040.00418.81
8.1.150.0040.00419.03
8.1.140.0050.00220.88
8.1.130.0030.00620.07
8.1.120.0070.00017.32
8.1.110.0000.00717.43
8.1.100.0000.00817.36
8.1.90.0040.00417.41
8.1.80.0070.00017.51
8.1.70.0070.00017.43
8.1.60.0000.00817.55
8.1.50.0040.00417.52
8.1.40.0050.00317.50
8.1.30.0040.00417.71
8.1.20.0050.00317.63
8.1.10.0000.00817.56
8.1.00.0080.00017.40
8.0.300.0000.00720.02
8.0.290.0040.00416.63
8.0.280.0000.00718.34
8.0.270.0000.00817.28
8.0.260.0030.00320.02
8.0.250.0070.00417.01
8.0.240.0030.00316.98
8.0.230.0000.00716.84
8.0.220.0030.00316.96
8.0.210.0000.00716.89
8.0.200.0000.00616.96
8.0.190.0000.00716.86
8.0.180.0030.00316.95
8.0.170.0070.00316.97
8.0.160.0080.00016.85
8.0.150.0030.00516.76
8.0.140.0040.00416.84
8.0.130.0060.00013.36
8.0.120.0000.00716.87
8.0.110.0020.00516.98
8.0.100.0000.00816.86
8.0.90.0040.00416.86
8.0.80.0120.00316.84
8.0.70.0030.00516.74
8.0.60.0000.00816.90
8.0.50.0050.00316.89
8.0.30.0110.00617.42
8.0.20.0040.01517.08
8.0.10.0080.00017.12
8.0.00.0140.00417.05
7.4.330.0050.00015.55
7.4.320.0030.00316.45
7.4.300.0060.00016.59
7.4.290.0000.00816.54
7.4.280.0000.00816.43
7.4.270.0000.00716.61
7.4.260.0030.00313.21
7.4.250.0040.00416.61
7.4.240.0030.00416.62
7.4.230.0030.00316.43
7.4.220.0020.00516.64
7.4.210.0080.00716.62
7.4.200.0000.00716.73
7.4.140.0030.02117.86
7.4.130.0090.00916.48
7.4.120.0170.00016.65
7.4.110.0110.00616.54
7.4.100.0110.00716.44
7.4.90.0110.00716.44
7.4.80.0100.00719.39
7.4.70.0130.00316.69
7.4.60.0100.00616.70
7.4.50.0040.00816.59
7.4.40.0100.00716.48
7.4.00.0060.01115.17
7.3.330.0050.00216.19
7.3.320.0050.00013.33
7.3.310.0060.00316.42
7.3.300.0060.00016.39
7.3.290.0070.00016.38
7.3.280.0030.01116.34
7.3.260.0080.01116.47
7.3.240.0130.00716.46
7.3.230.0100.01316.33
7.3.210.0110.00516.45
7.3.200.0080.01416.42
7.3.190.0030.01816.36
7.3.180.0070.01416.59
7.3.170.0180.00716.30
7.3.160.0060.00916.28
7.3.120.0050.00914.77
7.3.110.0060.01114.75
7.3.100.0060.00614.84
7.3.90.0070.00814.79
7.3.80.0090.00714.96
7.3.70.0060.00814.78
7.3.60.0060.00814.95
7.3.50.0070.00814.83
7.3.40.0040.01014.88
7.3.30.0040.01214.75
7.3.20.0140.00815.95
7.3.10.0100.00616.10
7.3.00.0070.01015.89
7.2.330.0030.01416.47
7.2.320.0140.00716.61
7.2.310.0050.01116.57
7.2.300.0090.00916.69
7.2.290.0000.01616.55
7.2.250.0070.00914.92
7.2.240.0090.00915.02
7.2.230.0070.00814.95
7.2.220.0150.01015.15
7.2.210.0080.00714.91
7.2.200.0060.00614.97
7.2.190.0100.00514.94
7.2.180.0110.00715.10
7.2.170.0090.00614.97
7.2.160.0150.00915.05
7.2.150.0090.01214.91
7.2.140.0090.01314.82
7.2.130.0130.00614.83
7.2.120.0160.00714.99
7.2.110.0150.00615.25
7.2.100.0130.01715.16
7.2.90.0100.01015.18
7.2.80.0170.00815.16
7.2.70.0130.01115.12
7.2.60.0120.00614.84
7.2.50.0090.00915.23
7.2.40.0070.01014.90
7.2.30.0070.01014.96
7.2.20.0190.00715.19
7.2.10.0230.01915.06
7.2.00.0070.01415.12
7.1.330.0040.01115.81
7.1.320.0090.01015.42
7.1.310.0060.01015.25
7.1.300.0090.00815.10
7.1.290.0080.00715.17
7.1.280.0050.01015.14
7.1.270.0080.01415.25
7.1.260.0040.01115.17
7.1.250.0110.00713.97

preferences:
16.17 ms | 403 KiB | 5 Q