3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '{"Template[URL]":"asdasdda.com","Template[UPC]":"548454854631… Example","FieldHow to Answer":"20"}'; $output = json_decode($json); print_r($output); $newArray = array(); $array = $output; foreach ($array as $key=>$value) { preg_match("/\[(.+)\]/",$key,$match); $newKey = preg_replace("/\[.+\]/","",$key); $newArray[$newKey][$match[1]] = $value; } print_r($newArray);

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.0040.01117.00
8.3.50.0090.01022.26
8.3.40.0160.00618.88
8.3.30.0140.00019.27
8.3.20.0070.00020.39
8.3.10.0080.00021.68
8.3.00.0030.00619.63
8.2.180.0120.00316.75
8.2.170.0140.00722.96
8.2.160.0130.00022.38
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0020.00519.79
8.2.110.0030.00719.39
8.2.100.0040.00817.97
8.2.90.0000.00818.34
8.2.80.0040.00417.97
8.2.70.0080.00017.75
8.2.60.0050.00518.05
8.2.50.0000.00918.07
8.2.40.0040.00420.06
8.2.30.0040.00418.14
8.2.20.0040.00418.04
8.2.10.0040.00418.16
8.2.00.0040.00417.96
8.1.280.0110.00725.92
8.1.270.0090.00020.65
8.1.260.0040.00426.35
8.1.250.0060.00328.09
8.1.240.0050.00522.71
8.1.230.0070.00420.92
8.1.220.0040.00417.77
8.1.210.0060.00319.04
8.1.200.0030.00617.48
8.1.190.0080.00017.36
8.1.180.0000.00918.10
8.1.170.0070.00320.50
8.1.160.0050.00222.08
8.1.150.0070.00018.83
8.1.140.0030.00617.56
8.1.130.0000.00717.72
8.1.120.0030.00717.58
8.1.110.0040.00417.66
8.1.100.0040.00417.59
8.1.90.0040.00417.54
8.1.80.0040.00417.65
8.1.70.0040.00417.55
8.1.60.0000.00917.77
8.1.50.0030.00717.75
8.1.40.0000.00817.66
8.1.30.0060.00317.66
8.1.20.0040.00417.75
8.1.10.0030.00617.72
8.1.00.0030.00517.59
8.0.300.0000.00720.09
8.0.290.0040.00416.88
8.0.280.0050.00218.34
8.0.270.0040.00417.20
8.0.260.0060.00017.18
8.0.250.0030.00317.15
8.0.240.0040.00417.15
8.0.230.0030.00317.20
8.0.220.0040.00417.11
8.0.210.0000.00717.07
8.0.200.0000.00617.14
8.0.190.0040.00417.16
8.0.180.0040.00417.14
8.0.170.0040.00417.11
8.0.160.0040.00417.15
8.0.150.0000.00716.99
8.0.140.0000.00817.08
8.0.130.0000.00713.53
8.0.120.0040.00416.95
8.0.110.0050.00217.13
8.0.100.0000.00817.11
8.0.90.0070.00016.89
8.0.80.0030.01317.09
8.0.70.0070.00017.14
8.0.60.0000.00716.94
8.0.50.0050.00216.98
8.0.30.0090.01117.30
8.0.20.0080.01117.40
8.0.10.0020.00517.07
8.0.00.0030.01816.93
7.4.330.0050.00015.03
7.4.320.0060.00016.80
7.4.300.0050.00316.81
7.4.290.0040.00416.73
7.4.280.0030.00516.80
7.4.270.0040.00416.76
7.4.260.0070.00016.68
7.4.250.0040.00416.77
7.4.240.0040.00416.84
7.4.230.0000.00716.81
7.4.220.0100.01016.79
7.4.210.0040.01016.69
7.4.200.0000.00716.88
7.4.160.0000.01616.55
7.4.150.0060.01217.40
7.4.140.0070.01017.86
7.4.130.0090.00916.82
7.4.120.0110.00716.81
7.4.110.0120.00616.73
7.4.100.0030.01316.72
7.4.90.0120.00416.84
7.4.80.0040.01419.39
7.4.70.0170.00716.77
7.4.60.0140.00316.48
7.4.50.0000.00816.73
7.4.40.0120.00716.69
7.4.30.0150.00616.87
7.4.00.0060.00914.82
7.3.330.0000.00513.46
7.3.320.0150.00013.38
7.3.310.0000.00716.58
7.3.300.0030.00316.53
7.3.290.0070.00016.45
7.3.280.0060.01016.56
7.3.270.0130.01317.40
7.3.260.0070.01816.88
7.3.250.0110.01016.69
7.3.240.0070.01016.61
7.3.230.0120.00416.66
7.3.210.0100.01316.80
7.3.200.0160.00016.54
7.3.190.0100.00616.47
7.3.180.0070.01016.60
7.3.170.0000.02116.66
7.3.160.0200.00316.63
7.2.330.0040.01416.92
7.2.320.0170.00816.70
7.2.310.0070.01016.65
7.2.300.0120.00616.80
7.2.290.0070.01116.81
7.2.00.0030.00619.84
7.1.100.0030.00918.15
7.1.70.0030.00717.46
7.1.60.0040.01519.50
7.1.50.0100.01017.27
7.1.00.0030.07722.48
7.0.200.0000.00716.90
7.0.140.0070.06721.92
7.0.60.0130.07020.02
7.0.50.0070.07317.68
7.0.40.0000.05019.92
7.0.30.0230.04020.11
7.0.20.0370.07020.05
7.0.10.0170.06320.10
7.0.00.0100.08020.19
5.6.280.0030.07021.09
5.6.210.0100.03320.52
5.6.200.0130.07718.15
5.6.190.0100.04020.60
5.6.180.0330.05020.59
5.6.170.0400.07320.50
5.6.160.0030.05320.37
5.6.150.0100.07318.22
5.6.140.0000.04318.09
5.6.130.0130.06318.21
5.6.120.0030.06721.13
5.6.110.0070.07721.09
5.6.100.0100.03320.95
5.6.90.0100.08020.95
5.6.80.0100.06020.39
5.5.350.0070.07020.40
5.5.340.0000.06718.00
5.5.330.0100.04020.35
5.5.320.0130.05020.20
5.5.310.0170.06020.39
5.5.300.0130.05017.88
5.5.290.0070.03717.91
5.5.280.0030.04320.98
5.5.270.0070.04020.86
5.5.260.0070.04020.95
5.5.250.0100.07320.46
5.5.240.0100.06320.35
5.4.450.0070.05719.24
5.4.440.0000.07719.47
5.4.430.0000.07019.57
5.4.420.0030.04019.40
5.4.410.0030.06019.33
5.4.400.0030.07318.92
5.4.390.0030.05319.08
5.4.380.0070.06318.88
5.4.370.0200.06018.89
5.4.360.0030.07719.10
5.4.350.0000.05319.09
5.4.340.0030.06319.09
5.4.320.0030.03719.21
5.4.310.0070.06719.21
5.4.300.0030.07719.09
5.4.290.0030.07019.21
5.4.280.0000.04718.88
5.4.270.0000.08019.24
5.4.260.0070.05719.07
5.4.250.0100.05318.80
5.4.240.0030.03719.08
5.4.230.0100.04319.13
5.4.220.0070.07319.05
5.4.210.0130.07019.07
5.4.200.0030.07018.80
5.4.190.0030.05719.08
5.4.180.0030.05719.14
5.4.170.0070.05319.23
5.4.160.0130.04718.91
5.4.150.0000.06018.89
5.4.140.0130.04716.23
5.4.130.0000.07716.24
5.4.120.0170.05016.30
5.4.110.0030.07316.39
5.4.100.0000.04716.48
5.4.90.0030.06316.38
5.4.80.0030.04716.38
5.4.70.0000.06016.30
5.4.60.0070.05016.36
5.4.50.0030.04316.41
5.4.40.0030.06716.44
5.4.30.0100.07016.45
5.4.20.0030.07716.17
5.4.10.0100.06016.36
5.4.00.0070.06715.76
5.3.290.0070.07714.50
5.3.280.0000.07714.45
5.3.270.0030.08014.66
5.3.260.0030.07714.64
5.3.250.0100.05014.56
5.3.240.0000.07714.45
5.3.230.0030.07714.52
5.3.220.0130.06014.40
5.3.210.0070.06314.59
5.3.200.0030.07314.40
5.3.190.0070.06314.50
5.3.180.0030.03714.42
5.3.170.0000.04314.44
5.3.160.0070.04714.52
5.3.150.0000.08014.42
5.3.140.0100.05014.49
5.3.130.0030.07314.58
5.3.120.0030.06714.39
5.3.110.0000.07014.41
5.3.100.0070.07313.95
5.3.90.0000.06313.97
5.3.80.0030.07714.05
5.3.70.0070.07014.11
5.3.60.0070.06314.09
5.3.50.0000.07313.88
5.3.40.0030.08013.86
5.3.30.0000.07713.77
5.3.20.0030.07013.60
5.3.10.0000.05013.46
5.3.00.0070.04313.50
5.2.170.0070.05712.27
5.2.160.0030.06312.27
5.2.150.0030.06012.27
5.2.140.0000.06012.27
5.2.130.0000.04312.27
5.2.120.0070.05712.27
5.2.110.0030.04712.27
5.2.100.0030.04312.27
5.2.90.0100.03312.27
5.2.80.0030.06312.27
5.2.70.0000.06012.27
5.2.60.0070.05012.27
5.2.50.0030.05012.27
5.2.40.0000.06312.27
5.2.30.0070.02712.27
5.2.20.0100.05312.27
5.2.10.0000.05312.27
5.2.00.0070.06012.27
5.1.60.0030.05712.27
5.1.50.0030.04712.27
5.1.40.0000.04712.27
5.1.30.0000.06012.27
5.1.20.0070.05012.27
5.1.10.0100.05012.27
5.1.00.0030.05312.27
5.0.50.0000.03012.27
5.0.40.0000.04712.27
5.0.30.0030.04712.27
5.0.20.0070.02012.27
5.0.10.0030.04312.27
5.0.00.0070.06012.27
4.4.90.0030.03712.27
4.4.80.0070.02712.27
4.4.70.0030.03012.27
4.4.60.0030.03012.27
4.4.50.0070.03312.27
4.4.40.0100.04712.27
4.4.30.0030.03712.27
4.4.20.0030.03012.27
4.4.10.0000.03012.27
4.4.00.0000.03312.27
4.3.110.0070.02712.27
4.3.100.0030.03312.27
4.3.90.0000.03712.27
4.3.80.0030.05312.27
4.3.70.0000.02712.27
4.3.60.0000.03012.27
4.3.50.0030.03012.27
4.3.40.0070.03312.27
4.3.30.0030.03712.27
4.3.20.0030.03712.27
4.3.10.0070.02312.27
4.3.00.0000.03312.27

preferences:
51.24 ms | 401 KiB | 5 Q