3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = array ( "products" => array( "category" => array( array( "product_sku" => "1", "product_type" => "Type", "customer_contact_name" => "Contact Name", "customer_telephone" => "0000 000 000", "customer_email" => "email@email.com", "customer_postcode" => "PostCode", "additional_info" => array( "some information" => "some information" ), "full_price" => "50.00", "product_name" => "Product Name", "product_id" => "1", "customer_rating" => "0" ), array( "product_sku" => "2", "product_type" => "Type", "customer_contact_name" => "Contact Name", "customer_telephone" => "0000 000 000", "customer_email" => "email@email.com", "customer_postcode" => "PostCode", "additional_info" => array( "some information" => "some information" ), "full_price" => "100.00", "product_name" => "Product Name", "product_id" => "2", "customer_rating" => "0" ) ) ) ); $array2 = array ( array( "product_sku" => "1", "product_type" => "Type", "contact_name" => "Contact Name", "phone" => "0000 000 000", "full_price" => "0.00", "product_name" => "Product Name", "product_id" => "1", "rating" => "0" ), array( "product_sku" => "3", "product_type" => "Type", "contact_name" => "Contact Name", "phone" => "0000 000 000", "full_price" => "80.00", "product_name" => "Product Name", "product_id" => "3", "rating" => "0" ) ); $skuFullPrices = array_column( $array1['products']['category'], 'full_price', 'product_sku' ); $array2 = array_map( fn($row) => array_replace( $row, ['full_price' => $skuFullPrices[$row['product_sku']] ?? $row['full_price']] ), $array2 ); usort( $array2, fn($a, $b) => $a['full_price'] <=> $b['full_price'] ); var_export($array2);

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.00819.97
8.5.00.0100.01119.77
8.4.160.0130.00823.73
8.4.150.0020.00014.05
8.4.140.0120.00917.50
8.4.130.0060.00317.75
8.4.120.0120.00822.29
8.4.110.0160.00522.54
8.4.100.0110.00919.11
8.4.90.0130.01020.71
8.4.80.0120.00718.69
8.4.70.0100.01018.11
8.4.60.0090.00718.97
8.4.50.0070.00319.43
8.4.40.0160.00320.55
8.4.30.0120.00618.61
8.4.20.0100.01020.45
8.4.10.0060.00924.14
8.3.280.0130.00718.65
8.3.270.0120.00816.52
8.3.260.0100.00816.90
8.3.250.0130.00519.13
8.3.240.0130.00616.64
8.3.230.0100.00816.79
8.3.220.0080.00619.09
8.3.210.0140.00616.48
8.3.200.0050.00316.57
8.3.190.0100.00516.62
8.3.180.0050.00416.90
8.3.170.0060.01019.00
8.3.160.0030.00518.31
8.3.150.0100.01018.95
8.3.140.0110.00416.61
8.3.130.0070.01116.56
8.3.120.0090.00020.61
8.3.110.0040.00420.94
8.3.100.0060.00324.06
8.3.90.0090.00526.77
8.3.80.0030.00617.97
8.3.70.0100.01016.63
8.3.60.0080.00818.31
8.3.50.0150.00618.45
8.3.40.0110.00319.79
8.3.30.0110.00418.76
8.3.20.0040.00424.18
8.3.10.0080.00024.66
8.3.00.0080.00026.16
8.2.290.0110.00620.44
8.2.280.0080.00718.68
8.2.270.0040.00416.57
8.2.260.0040.00418.95
8.2.250.0170.00316.77
8.2.240.0090.00617.18
8.2.230.0080.00022.58
8.2.220.0050.00537.54
8.2.210.0000.00726.77
8.2.200.0060.00316.63
8.2.190.0090.00618.27
8.2.180.0070.00716.50
8.2.170.0140.00318.94
8.2.160.0070.01022.96
8.2.150.0040.00425.66
8.2.140.0000.00724.66
8.2.130.0080.00026.16
8.2.120.0080.00019.13
8.2.110.0110.00022.29
8.2.100.0080.00317.71
8.2.90.0040.00418.28
8.2.80.0000.00817.97
8.2.70.0050.00317.63
8.2.60.0000.00817.63
8.2.50.0190.00019.52
8.2.40.0110.00519.52
8.2.30.0080.00819.52
8.2.20.0180.00019.52
8.2.10.0180.00019.52
8.2.00.0120.00819.52
8.1.330.0120.00821.97
8.1.320.0120.00818.52
8.1.310.0170.00018.74
8.1.300.0030.00617.78
8.1.290.0060.00330.84
8.1.280.0100.00725.92
8.1.270.0040.00424.66
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0100.00023.97
8.1.230.0110.00020.83
8.1.220.0040.00417.79
8.1.210.0030.00618.77
8.1.200.0080.00017.48
8.1.190.0080.00017.36
8.1.180.0110.00719.52
8.1.170.0090.00919.52
8.1.160.0100.00719.52
8.1.150.0130.00319.52
8.1.140.0000.01719.52
8.1.130.0170.00019.52
8.1.120.0130.00319.52
8.1.110.0130.00319.52
8.1.100.0130.00319.52
8.1.90.0150.00319.52
8.1.80.0040.01119.52
8.1.70.0000.01719.52
8.1.60.0090.01219.52
8.1.50.0110.00819.52
8.1.40.0160.00219.52
8.1.30.0150.00319.52
8.1.20.0220.00319.52
8.1.10.0170.00019.52
8.1.00.0100.00719.52
8.0.300.0070.00020.16
8.0.290.0000.00716.75
8.0.280.0150.00019.52
8.0.270.0160.00019.52
8.0.260.0120.00419.52
8.0.250.0140.00319.52
8.0.240.0040.01119.52
8.0.230.0110.00519.52
8.0.220.0110.00519.52
8.0.210.0120.00419.52
8.0.200.0130.00319.52
8.0.190.0100.00819.52
8.0.180.0140.00619.52
8.0.170.0140.00419.52
8.0.160.0130.00319.52
8.0.150.0100.00619.52
8.0.140.0100.00619.52
8.0.130.0160.00019.52
8.0.120.0110.00619.52
8.0.110.0140.00319.52
8.0.100.0170.00019.52
8.0.90.0050.01119.52
8.0.80.0060.01219.52
8.0.70.0180.00019.52
8.0.60.0060.01019.52
8.0.50.0080.00819.52
8.0.30.0160.00019.52
8.0.20.0130.00319.52
8.0.10.0120.00419.52

preferences:
45.56 ms | 403 KiB | 5 Q