3v4l.org

run code in 300+ PHP versions simultaneously
<?php $jsonArray = '[{"Level":"77.2023%","Product":"Milk","Temperature":"4"}, {"Level":"399.2023%","Product":"Coffee","Temperature":"34"}, {"Level":"109.2023%","Product":"Chocolate","Temperature":"14"}]'; $output = array(); foreach (json_decode($jsonArray, true) as $row) { $product = $row['Product']; $output[$product] = $row; unset($output[$product]['Product']); } echo json_encode($output) . "\n";

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.0100.00917.74
8.4.120.0100.01022.39
8.4.110.0100.00918.63
8.4.100.0130.00717.71
8.4.90.0130.00717.79
8.4.80.0120.00817.92
8.4.70.0100.00917.98
8.4.60.0090.00618.78
8.4.50.0120.00819.62
8.4.40.0130.00319.43
8.4.30.0030.01617.57
8.4.20.0130.00720.62
8.4.10.0090.00017.81
8.3.260.0140.00516.48
8.3.250.0100.00818.95
8.3.240.0140.00516.71
8.3.230.0150.00416.79
8.3.220.0040.00416.71
8.3.210.0090.00616.52
8.3.200.0050.00316.78
8.3.190.0100.00717.32
8.3.180.0090.01016.49
8.3.170.0070.01117.04
8.3.160.0140.00918.58
8.3.150.0090.00920.71
8.3.140.0000.01920.58
8.3.130.0070.01016.58
8.3.120.0070.00418.88
8.3.110.0050.00520.94
8.3.100.0080.00018.41
8.3.90.0000.00826.77
8.3.80.0030.00616.50
8.3.70.0140.00416.58
8.3.60.0090.00918.31
8.3.50.0070.01018.26
8.3.40.0150.00318.97
8.3.30.0130.00318.77
8.3.20.0070.00021.77
8.3.10.0040.00423.73
8.3.00.0070.00023.52
8.2.290.0100.00918.88
8.2.280.0060.00318.36
8.2.270.0130.00616.90
8.2.260.0040.00418.13
8.2.250.0080.00816.62
8.2.240.0100.01019.08
8.2.230.0000.00922.58
8.2.220.0060.00324.06
8.2.210.0110.00726.77
8.2.200.0030.00616.63
8.2.190.0060.01216.63
8.2.180.0100.00625.92
8.2.170.0110.00422.96
8.2.160.0070.01019.85
8.2.150.0040.00424.18
8.2.140.0000.00724.66
8.2.130.0000.00726.16
8.2.120.0040.00420.93
8.2.110.0000.01019.24
8.2.100.0060.00618.03
8.2.90.0000.00818.18
8.2.80.0080.00018.04
8.2.70.0040.00418.05
8.2.60.0070.00318.34
8.2.50.0030.00518.10
8.2.40.0070.00019.42
8.2.30.0020.00519.28
8.2.20.0050.00218.09
8.2.10.0080.00019.16
8.2.00.0000.00719.25
8.1.330.0110.00716.28
8.1.320.0110.01016.30
8.1.310.0110.00716.76
8.1.300.0000.00818.11
8.1.290.0060.00330.84
8.1.280.0140.00025.92
8.1.270.0050.00520.45
8.1.260.0030.00626.35
8.1.250.0040.00428.09
8.1.240.0110.00317.58
8.1.230.0080.00421.04
8.1.220.0050.00317.79
8.1.210.0060.00318.90
8.1.200.0030.00617.35
8.1.190.0000.00917.25
8.1.180.0000.00818.10
8.1.170.0030.00618.47
8.1.160.0070.00018.94
8.1.150.0030.00318.89
8.1.140.0050.00220.68
8.1.130.0030.00320.18
8.1.120.0070.00317.42
8.1.110.0070.00017.46
8.1.100.0030.00317.51
8.1.90.0000.00717.38
8.1.80.0070.00017.35
8.1.70.0000.00717.35
8.1.60.0060.00317.47
8.1.50.0000.00717.57
8.1.40.0030.00717.49
8.1.30.0000.00817.48
8.1.20.0000.00917.63
8.1.10.0060.00317.59
8.1.00.0040.00417.48
8.0.300.0000.00819.65
8.0.290.0000.00816.63
8.0.280.0030.00318.48
8.0.270.0070.00017.30
8.0.260.0040.00420.25
8.0.250.0000.00816.95
8.0.240.0000.00716.89
8.0.230.0050.00316.94
8.0.220.0000.00716.90
8.0.210.0050.00316.75
8.0.200.0050.00316.97
8.0.190.0040.00416.98
8.0.180.0050.00316.97
8.0.170.0040.00416.94
8.0.160.0040.00416.90
8.0.150.0050.00216.89
8.0.140.0050.00316.83
8.0.130.0030.00313.19
8.0.120.0040.00416.88
8.0.110.0040.00416.93
8.0.100.0070.00016.71
8.0.90.0050.00216.94
8.0.80.0050.01316.88
8.0.70.0030.00616.83
8.0.60.0000.00816.85
8.0.50.0040.00416.89
8.0.30.0110.00717.23
8.0.20.0130.01117.40
8.0.10.0050.00216.98
8.0.00.0110.01016.71
7.4.330.0000.00515.55
7.4.320.0000.00616.46
7.4.300.0000.00716.40
7.4.290.0030.00316.62
7.4.280.0050.00316.40
7.4.270.0040.00416.58
7.4.260.0000.00716.59
7.4.250.0070.00016.41
7.4.240.0000.00816.49
7.4.230.0050.00216.50
7.4.220.0000.00716.62
7.4.210.0060.00916.55
7.4.200.0030.00316.57
7.4.160.0070.01016.73
7.4.140.0100.00817.86
7.4.130.0120.00616.66
7.4.120.0040.01216.62
7.4.110.0030.02016.64
7.4.100.0180.00416.50
7.4.90.0070.01016.60
7.4.80.0150.00319.39
7.4.70.0120.00316.54
7.4.60.0100.00716.50
7.4.50.0060.00316.36
7.4.40.0130.01016.63
7.4.10.0150.00315.13
7.4.00.0090.00914.80
7.3.330.0050.00013.08
7.3.320.0030.00313.04
7.3.310.0040.00416.34
7.3.300.0030.00316.35
7.3.290.0030.00316.35
7.3.280.0070.00916.29
7.3.260.0100.01116.46
7.3.240.0120.00716.41
7.3.230.0150.00616.40
7.3.210.0030.01316.36
7.3.200.0070.01016.40
7.3.190.0110.00716.59
7.3.180.0030.01716.69
7.3.170.0080.00816.67
7.3.160.0040.01316.52
7.3.130.0130.00714.87
7.3.120.0060.00914.48
7.3.110.0090.00914.81
7.3.100.0070.00714.79
7.3.90.0060.01014.87
7.3.80.0040.01214.99
7.3.70.0000.00914.93
7.3.60.0120.00314.84
7.3.50.0040.01214.96
7.3.40.0030.01014.89
7.3.30.0070.01114.96
7.3.20.0080.00616.53
7.3.10.0250.01115.87
7.3.00.0220.00816.05
7.2.330.0070.01116.68
7.2.320.0120.00616.59
7.2.310.0120.00616.57
7.2.300.0100.00716.67
7.2.290.0100.00716.57
7.2.260.0070.01315.06
7.2.250.0100.00715.27
7.2.240.0080.00515.08
7.2.230.0090.00615.09
7.2.220.0070.01315.06
7.2.210.0070.00715.37
7.2.200.0070.00315.18
7.2.190.0080.00814.83
7.2.180.0040.01115.12
7.2.170.0060.00914.81
7.2.160.0090.00015.18
7.2.150.0050.00516.91
7.2.140.0000.01117.03
7.2.130.0380.00516.33
7.2.120.0290.00716.22
7.2.110.0250.00516.18
7.2.100.0180.00816.18
7.2.90.0190.00516.34
7.2.80.0230.00916.20
7.2.70.0250.00716.18
7.2.60.0250.01216.24
7.2.50.0320.00916.19
7.2.40.0230.01316.20
7.2.30.0260.00616.16
7.2.20.0190.00716.06
7.2.10.0170.01016.15
7.2.00.0320.00816.15
7.1.330.0070.00715.93
7.1.320.0070.00715.85
7.1.310.0030.01315.86
7.1.300.0000.01515.74
7.1.290.0070.00715.78
7.1.280.0030.01015.86
7.1.270.0110.00415.88
7.1.260.0070.00315.79
7.1.250.0230.00915.08
7.1.240.0080.00815.60
7.1.230.0070.00315.86
7.1.220.0030.00615.99
7.1.210.0110.00315.57
7.1.200.0100.00315.95
7.1.190.0000.01415.76
7.1.180.0030.00915.61
7.1.170.0030.00715.88
7.1.160.0040.00915.68
7.1.150.0030.00515.68
7.1.140.0070.00715.98
7.1.130.0060.00615.97
7.1.120.0110.00415.58
7.1.110.0060.00615.72
7.1.100.0070.00716.03
7.1.90.0030.00815.78
7.1.80.0080.00415.56
7.1.70.0070.00715.77
7.1.60.0060.00915.83
7.1.50.0060.00915.78
7.1.40.0070.00715.68
7.1.30.0070.00615.79
7.1.20.0000.01115.75
7.1.10.0030.00615.92
7.1.00.0070.00715.77

preferences:
30.23 ms | 403 KiB | 5 Q