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); foreach($price as $key => $value) { foreach($json as $k => $value2) { if ($value['name'] === $value2['name']){ $json[$k]['price'] = $value['prices']['last']; } } } 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.00418.39
8.3.50.0140.00716.34
8.3.40.0090.00618.79
8.3.30.0110.00318.83
8.3.20.0000.00721.88
8.3.10.0040.00420.38
8.3.00.0090.00021.77
8.2.180.0100.01416.75
8.2.170.0070.00722.96
8.2.160.0070.00720.35
8.2.150.0110.00325.66
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0000.00826.16
8.2.110.0120.00322.21
8.2.100.0060.00619.25
8.2.90.0040.00419.52
8.2.80.0030.00520.57
8.2.70.0000.00817.50
8.2.60.0030.00517.93
8.2.50.0000.00817.58
8.2.40.0040.00417.62
8.2.30.0090.00017.76
8.2.20.0040.00418.04
8.2.10.0000.00719.25
8.2.00.0030.00519.38
8.1.280.0110.00325.92
8.1.270.0000.00820.92
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0030.00720.92
8.1.230.0070.00420.89
8.1.220.0080.00017.79
8.1.210.0060.00318.92
8.1.200.0060.00317.48
8.1.190.0000.00717.23
8.1.180.0030.00618.10
8.1.170.0050.00217.62
8.1.160.0000.00718.90
8.1.150.0070.00018.92
8.1.140.0040.00422.03
8.1.130.0000.00720.15
8.1.120.0000.00717.47
8.1.110.0000.00817.45
8.1.100.0000.00817.49
8.1.90.0000.00717.34
8.1.80.0030.00517.52
8.1.70.0040.00417.36
8.1.60.0060.00317.62
8.1.50.0080.00017.56
8.1.40.0000.00817.58
8.1.30.0070.00317.66
8.1.20.0050.00317.66
8.1.10.0080.00017.66
8.1.00.0080.00017.51
8.0.300.0070.00020.09
8.0.290.0050.00316.58
8.0.280.0030.00318.46
8.0.270.0030.00517.91
8.0.260.0030.00320.00
8.0.250.0000.00716.89
8.0.240.0060.00316.86
8.0.230.0080.00016.99
8.0.220.0000.00816.88
8.0.210.0020.00516.80
8.0.200.0000.00617.01
8.0.190.0030.00616.93
8.0.180.0030.00516.91
8.0.170.0040.00416.93
8.0.160.0030.00416.81
8.0.150.0070.00016.82
8.0.140.0050.00216.88
8.0.130.0030.00313.32
8.0.120.0040.00416.78
8.0.110.0070.00016.95
8.0.100.0070.00016.95
8.0.90.0040.00416.87
8.0.80.0120.00416.96
8.0.70.0000.00716.70
8.0.60.0000.00816.91
8.0.50.0040.00416.73
8.0.30.0030.01317.44
8.0.20.0040.01416.93
8.0.10.0060.00317.07
8.0.00.0120.00617.03
7.4.330.0050.00015.55
7.4.320.0000.00616.61
7.4.300.0060.00016.62
7.4.290.0000.00816.40
7.4.280.0040.00416.50
7.4.270.0070.00016.51
7.4.260.0000.00613.35
7.4.250.0000.00716.34
7.4.240.0040.00216.63
7.4.230.0070.00016.54
7.4.220.0000.00716.41
7.4.210.0040.01416.54
7.4.200.0040.00416.53
7.4.130.0100.00716.39
7.4.120.0060.01216.36
7.4.110.0090.00916.71
7.4.100.0080.00816.52
7.4.90.0060.01116.46
7.4.80.0110.01219.39
7.4.70.0060.01216.58
7.4.60.0110.00516.69
7.4.50.0080.00216.49
7.4.40.0130.00316.42
7.4.00.0110.00414.83
7.3.330.0000.00716.38
7.3.320.0030.00213.14
7.3.310.0030.00316.45
7.3.300.0030.00316.35
7.3.290.0030.00516.18
7.3.280.0090.00916.23
7.3.260.0080.00816.48
7.3.230.0060.01516.29
7.3.210.0080.00816.74
7.3.200.0030.01216.54
7.3.190.0100.00716.74
7.3.180.0120.00916.52
7.3.170.0000.01516.52
7.3.160.0070.01016.59
7.3.120.0120.00614.72
7.3.110.0110.00314.92
7.3.100.0060.01014.57
7.3.90.0110.00414.82
7.3.80.0040.01514.73
7.3.70.0070.01014.84
7.3.60.0060.01014.71
7.3.50.0040.01114.95
7.3.40.0070.00714.81
7.3.30.0110.00314.80
7.3.20.0030.01314.64
7.3.10.0030.01214.80
7.3.00.0110.00414.88
7.2.330.0070.01016.77
7.2.320.0030.01316.51
7.2.310.0120.00616.73
7.2.300.0200.00316.39
7.2.290.0030.01316.66
7.2.250.0090.00915.23
7.2.240.0070.01114.78
7.2.230.0050.01114.82
7.2.220.0100.00414.98
7.2.210.0030.01315.06
7.2.200.0040.01615.00
7.2.190.0100.00715.17
7.2.180.0080.00814.84
7.2.170.0030.01014.79
7.1.330.0110.00613.95
7.1.320.0070.00913.64
7.1.310.0090.01013.98
7.1.300.0100.00514.04
7.1.290.0030.01013.95
7.1.280.0030.01113.73
7.1.270.0070.00713.90
7.1.260.0110.00414.10

preferences:
63.26 ms | 401 KiB | 5 Q