3v4l.org

run code in 300+ PHP versions simultaneously
<?php $saved_royalties = [ [ 'gross_total' => 1.797, 'track_name' => 'Desert Dance', 'transaction_type' => 'S' ], [ 'gross_total' => 0.0678, 'track_name' => 'Memphis City Of Kings', 'transaction_type' => 'AS' ], [ 'gross_total' => 0.023, 'track_name' => 'North African Market', 'transaction_type' => 'MT' ], [ 'gross_total' => 0.1173, 'track_name' => 'The Oracle', 'transaction_type' => 'CL' ] ]; $matching_royalty_rows = [ [ 'gross_total' => 2.435174, 'track_name' => 'Desert Dance', 'transaction_type' => 'S' ], [ 'gross_total' => 0.336815, 'track_name' => 'Memphis City Of Kings', 'transaction_type' => 'AS' ], [ 'gross_total' => 0.214106, 'track_name' => 'The Oracle', 'transaction_type' => 'CL' ] ]; $lookup = array_column($matching_royalty_rows, null, 'track_name'); $combined_rows = []; foreach ($saved_royalties as $row) { if (isset($lookup[$row['track_name']])) { $row = $lookup[$row['track_name']]; } else { $row['gross_total'] = 0; } $combined_rows[] = $row; } var_export($combined_rows);

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.0090.01020.27
8.5.00.0090.01320.14
8.4.160.0160.00923.80
8.4.150.0020.00014.05
8.4.140.0120.00917.49
8.4.130.0020.00717.67
8.4.120.0130.00522.04
8.4.110.0090.01122.57
8.4.100.0130.00917.54
8.4.90.0060.00418.54
8.4.80.0140.00617.82
8.4.70.0110.01017.84
8.4.60.0110.00918.74
8.4.50.0120.00819.26
8.4.40.0060.01319.80
8.4.30.0060.01618.96
8.4.20.0070.01322.34
8.4.10.0060.00323.54
8.3.280.0130.00918.35
8.3.270.0170.00716.68
8.3.260.0120.00816.46
8.3.250.0110.00718.98
8.3.240.0070.00316.51
8.3.230.0090.01016.64
8.3.220.0170.00217.28
8.3.210.0100.00916.80
8.3.200.0060.00216.73
8.3.190.0130.00517.31
8.3.180.0110.00716.67
8.3.170.0150.00317.05
8.3.160.0130.00618.36
8.3.150.0090.00920.63
8.3.140.0060.00316.69
8.3.130.0060.00316.66
8.3.120.0030.00618.85
8.3.110.0000.00920.94
8.3.100.0060.00324.06
8.3.90.0040.01126.77
8.3.80.0090.00018.56
8.3.70.0070.00716.63
8.3.60.0120.00916.63
8.3.50.0110.00719.82
8.3.40.0140.00020.34
8.3.30.0140.00018.84
8.3.20.0030.00624.18
8.3.10.0040.00424.66
8.3.00.0000.00726.16
8.2.290.0070.00420.59
8.2.280.0060.00318.45
8.2.270.0070.01119.08
8.2.260.0050.00320.02
8.2.250.0040.00417.02
8.2.240.0050.00317.09
8.2.230.0050.00522.58
8.2.220.0030.00637.54
8.2.210.0110.00726.77
8.2.200.0060.00316.75
8.2.190.0090.00616.63
8.2.180.0090.00625.92
8.2.170.0140.00718.94
8.2.160.0070.00722.96
8.2.150.0040.00425.66
8.2.140.0030.00624.66
8.2.130.0040.00426.16
8.2.120.0000.00821.12
8.2.110.0080.00022.27
8.2.100.0040.01017.91
8.2.90.0030.00518.03
8.2.80.0060.00318.75
8.2.70.0040.00417.75
8.2.60.0040.00417.93
8.2.50.0060.00318.07
8.2.40.0040.00419.88
8.2.30.0040.00418.18
8.2.20.0000.00819.21
8.2.10.0000.00718.04
8.2.00.0050.00219.36
8.1.330.0120.00722.02
8.1.320.0100.00915.85
8.1.310.0050.00316.81
8.1.300.0040.00418.46
8.1.290.0060.00330.84
8.1.280.0150.00325.92
8.1.270.0080.00024.66
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0030.00621.90
8.1.230.0040.00817.76
8.1.220.0030.00517.74
8.1.210.0050.00318.77
8.1.200.0030.00817.48
8.1.190.0000.00917.35
8.1.180.0000.00818.10
8.1.170.0000.00818.71
8.1.160.0040.00418.93
8.1.150.0030.00518.69
8.1.140.0040.00417.49
8.1.130.0080.00017.46
8.1.120.0040.00417.47
8.1.110.0110.00517.40
8.1.100.0140.00317.42
8.1.90.0080.00717.48
8.1.80.0050.01017.24
8.1.70.0120.00317.40
8.1.60.0110.00717.51
8.1.50.0160.00217.47
8.1.40.0100.00817.49
8.1.30.0140.00317.63
8.1.20.0180.00017.48
8.1.10.0090.00917.39
8.1.00.0150.00317.40
8.0.300.0100.00018.77
8.0.290.0040.00416.75
8.0.280.0070.00018.52
8.0.270.0000.00817.33
8.0.260.0030.00316.84
8.0.250.0070.00016.98
8.0.240.0140.00016.91
8.0.230.0000.01416.94
8.0.220.0070.00716.85
8.0.210.0110.00316.94
8.0.200.0130.00316.96
8.0.190.0110.00416.94
8.0.180.0140.00016.77
8.0.170.0100.00516.86
8.0.160.0080.00816.89
8.0.150.0140.00316.80
8.0.140.0170.00316.79
8.0.130.0100.00616.86
8.0.120.0140.00516.91
8.0.110.0060.00616.89
8.0.100.0130.00316.72
8.0.90.0140.00416.76
8.0.80.0160.00216.72
8.0.70.0140.00416.71
8.0.60.0140.00216.74
8.0.50.0100.00516.85
8.0.30.0180.00016.77
8.0.20.0140.00416.95
8.0.10.0140.00916.99
7.4.330.0060.00015.55
7.4.320.0200.00016.52
7.4.300.0100.01016.52
7.4.290.0110.00416.48
7.4.280.0100.00616.34
7.4.270.0150.00216.43
7.4.260.0110.00416.48
7.4.250.0100.00216.27
7.4.240.0120.00216.47
7.4.230.0060.00916.59
7.4.220.0100.00516.50
7.4.210.0050.01116.51
7.4.200.0120.00616.35
7.4.190.0130.00416.62
7.4.180.0140.00416.62
7.4.160.0100.00516.62
7.4.150.0060.00916.48
7.4.140.0120.00416.46
7.4.130.0160.00016.30
7.4.120.0130.00216.39
7.4.110.0120.00416.34
7.4.100.0150.00016.45
7.4.90.0100.00516.43
7.4.80.0080.00916.47
7.4.70.0120.00516.27
7.4.60.0040.01116.39
7.4.50.0140.00316.50
7.4.40.0100.00616.38
7.4.30.0110.00516.45
7.4.20.0160.00016.26
7.4.10.0090.00816.48
7.4.00.0030.01316.53

preferences:
34.69 ms | 403 KiB | 5 Q