3v4l.org

run code in 300+ PHP versions simultaneously
<?php $jsonProducts = '[ { "name": "Fluted Guard of the Moon Rider", "icon": "-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KW1Zwwo4NUX4oFJZEHLbXK9QlSPcU_oAlcQk2fVOiSxMfcRlFwIBYYpbaaOA9vxv_MdC8M7tq0xoaOzvb2Z7iJxD8GsJIi0--Up9Sh0A2yr0pvZ22iJdXGdVQ5NUaQpAZGHIGG2g" }, { "name": "Lion Quiver of the Moon Rider", "icon": "-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KW1Zwwo4NUX4oFJZEHLbXK9QlSPcU_oAlcQk2fVOiSxtraRVhmahdbiauwIhFlwb2aImoS7oWwzIPYwqetYeKExm9SsMAg3b7AoNz32QDkqUNtMD2lJdPGbEZgNjYx8IO6" }, { "name": "Lion Quiver of the Moon Rider", "icon": "-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KW1Zwwo4NUX4oFJZEHLbXK9QlSPcU_oAlcQk2fVOiSxtraRVhmahdbiauwIhFlwb2aImoS7oWwzIPYwqetYeKExm9SsMAg3b7AoNz32QDkqUNtMD2lJdPGbEZgNjYx8IO6" } ]'; $jsonData = '{ "data": [ { "updated_at": 1576048969000, "prices": { "last": 5300 }, "name": "Lion Quiver of the Moon Rider" }, { "updated_at": 1576048969000, "prices": { "last": 2000.12 }, "name": "T-shirts" } ] }'; echo "<pre>"; $price = json_decode($jsonData, 1)['data']; $json = json_decode($jsonProducts, 1); $bool = false; foreach($price as $key => $value) { foreach($json as $k => $value2) { if ($value['name'] === $value2['name']) { if ($bool !== true) { $json[$k]['price'] = $value['prices']['last']; $bool = true; } } } } print_r($json);

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.3.60.0140.00718.68
8.3.50.0110.00416.62
8.3.40.0060.00918.76
8.3.30.0080.00818.72
8.3.20.0000.00821.59
8.3.10.0040.00420.21
8.3.00.0000.00721.85
8.2.180.0120.00918.04
8.2.170.0140.00022.96
8.2.160.0110.00320.34
8.2.150.0100.00024.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0000.00826.16
8.2.110.0050.00520.44
8.2.100.0090.00617.91
8.2.90.0030.00517.75
8.2.80.0040.00418.73
8.2.70.0000.00817.75
8.2.60.0000.00817.47
8.2.50.0080.00017.58
8.2.40.0080.00019.50
8.2.30.0040.00417.67
8.2.20.0040.00418.22
8.2.10.0040.00419.26
8.2.00.0050.00219.25
8.1.280.0100.00725.92
8.1.270.0040.00420.73
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0120.00022.14
8.1.230.0080.00422.10
8.1.220.0080.00018.68
8.1.210.0040.00418.77
8.1.200.0030.00517.48
8.1.190.0080.00017.22
8.1.180.0000.00818.10
8.1.170.0060.00317.62
8.1.160.0000.00818.98
8.1.150.0070.00018.94
8.1.140.0000.00722.05
8.1.130.0030.00320.09
8.1.120.0030.00517.48
8.1.110.0090.00017.45
8.1.100.0000.00817.49
8.1.90.0020.00517.51
8.1.80.0040.00417.50
8.1.70.0030.00317.54
8.1.60.0000.00917.51
8.1.50.0000.01017.55
8.1.40.0040.00417.60
8.1.30.0000.00817.71
8.1.20.0040.00417.65
8.1.10.0030.00517.63
8.1.00.0060.00317.48
8.0.300.0070.00018.77
8.0.290.0050.00316.75
8.0.280.0000.00718.36
8.0.270.0030.00617.97
8.0.260.0060.00020.10
8.0.250.0000.00716.94
8.0.240.0000.01016.97
8.0.230.0000.00817.03
8.0.220.0000.00816.93
8.0.210.0000.00716.95
8.0.200.0040.00417.05
8.0.190.0060.00316.96
8.0.180.0040.00416.91
8.0.170.0030.00616.99
8.0.160.0040.00416.92
8.0.150.0030.00616.86
8.0.140.0040.00416.93
8.0.130.0000.00613.32
8.0.120.0000.00816.78
8.0.110.0060.00316.96
8.0.100.0000.00816.97
8.0.90.0030.00616.73
8.0.80.0090.00616.99
8.0.70.0000.00816.90
8.0.60.0040.00416.89
8.0.50.0000.00716.99
8.0.30.0060.01017.30
8.0.20.0120.00617.41
8.0.10.0030.00517.07
8.0.00.0120.00616.88
7.4.330.0020.00215.55
7.4.320.0030.00316.67
7.4.300.0000.00716.70
7.4.290.0050.00216.62
7.4.280.0060.00316.56
7.4.270.0040.00416.68
7.4.260.0030.00313.30
7.4.250.0000.00816.49
7.4.240.0020.00616.56
7.4.230.0030.00316.39
7.4.220.0000.00716.69
7.4.210.0090.00716.59
7.4.200.0030.00316.75
7.4.140.0120.01217.86
7.4.130.0100.01016.69
7.4.120.0130.00416.60
7.4.110.0080.01216.54
7.4.100.0060.01216.44
7.4.90.0090.00916.70
7.4.80.0100.00719.39
7.4.70.0150.00416.65
7.4.60.0100.00716.32
7.4.50.0000.01116.61
7.4.40.0070.01616.56
7.4.00.0060.01014.79
7.3.330.0050.00216.20
7.3.320.0050.00013.21
7.3.310.0050.00316.20
7.3.300.0000.00716.24
7.3.290.0030.00316.36
7.3.280.0030.01116.45
7.3.260.0150.00616.64
7.3.230.0090.00616.67
7.3.210.0100.00716.61
7.3.200.0120.00416.73
7.3.190.0100.00616.34
7.3.180.0100.00616.47
7.3.170.0030.01316.57
7.3.160.0080.00816.38
7.3.120.0090.00615.06
7.3.110.0100.00714.91
7.3.100.0080.00814.53
7.3.90.0080.00814.63
7.3.80.0130.00514.91
7.3.70.0130.00314.88
7.3.60.0090.00714.98
7.3.50.0050.01514.89
7.3.40.0090.00814.80
7.3.30.0090.00614.86
7.3.20.0070.01014.96
7.3.10.0110.00614.77
7.3.00.0120.00914.70
7.2.330.0110.00816.63
7.2.320.0110.00816.75
7.2.310.0130.00316.76
7.2.300.0180.00016.79
7.2.290.0060.01216.48
7.2.250.0110.00615.16
7.2.240.0060.01315.00
7.2.230.0090.00614.53
7.2.220.0070.00714.71
7.2.210.0130.00714.96
7.2.200.0060.00915.18
7.2.190.0110.00715.12
7.2.180.0050.00914.91
7.2.170.0030.01414.84
7.1.330.0030.01014.11
7.1.320.0090.00913.73
7.1.310.0120.00613.89
7.1.300.0060.00913.80
7.1.290.0040.01213.85
7.1.280.0060.01114.02
7.1.270.0090.00913.90
7.1.260.0090.01214.06

preferences:
74.13 ms | 401 KiB | 5 Q