3v4l.org

run code in 300+ PHP versions simultaneously
<?php $var = '[{"player":"Tiger Woods"},{"player":"Gary Player"}]'; $temp = json_decode($var, true); function json_change_key($arr, $oldkey, $newkey) { $json = str_replace('"'.$oldkey.'":', '"'.$newkey.'":', json_encode($arr)); return json_decode($json, true); } $temp = json_change_key($temp, 'player', 'golfer'); print_r($temp);

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.00.0140.00719.93
8.4.150.0030.00014.05
8.4.140.0110.01117.66
8.4.130.0080.00717.45
8.4.120.0110.00624.18
8.4.110.0070.00324.18
8.4.100.0100.00717.86
8.4.90.0130.00717.90
8.4.80.0090.00917.73
8.4.70.0060.00219.37
8.4.60.0150.00618.79
8.4.50.0050.00319.34
8.4.40.0040.00419.56
8.4.30.0030.01722.43
8.4.20.0100.01020.71
8.4.10.0060.00319.39
8.3.280.0120.01018.57
8.3.270.0130.01016.48
8.3.260.0120.00716.57
8.3.250.0100.00916.45
8.3.240.0120.00916.44
8.3.230.0100.00916.63
8.3.220.0110.00716.85
8.3.210.0100.00816.49
8.3.200.0040.00516.68
8.3.190.0110.00816.96
8.3.180.0030.00516.66
8.3.170.0150.00318.99
8.3.160.0140.00318.37
8.3.150.0060.01220.57
8.3.140.0080.00316.56
8.3.130.0080.00016.43
8.3.120.0030.00618.96
8.3.110.0050.00320.94
8.3.100.0090.00024.06
8.3.90.0080.00026.77
8.3.80.0060.00318.68
8.3.70.0070.00718.43
8.3.60.0120.00418.56
8.3.50.0100.00718.24
8.3.40.0090.00918.79
8.3.30.0120.00318.68
8.3.20.0080.00021.76
8.3.10.0080.00021.90
8.3.00.0000.00823.61
8.2.290.0090.00520.39
8.2.280.0070.00818.54
8.2.270.0050.00517.04
8.2.260.0130.00318.43
8.2.250.0090.00918.26
8.2.240.0150.00318.93
8.2.230.0150.00022.58
8.2.220.0060.00337.54
8.2.210.0100.01026.77
8.2.200.0060.00318.41
8.2.190.0140.00016.63
8.2.180.0100.01016.50
8.2.170.0040.01122.96
8.2.160.0070.01421.04
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0050.00326.16
8.2.120.0070.00026.16
8.2.110.0060.00319.46
8.2.100.0090.00317.78
8.2.90.0040.00419.27
8.2.80.0080.00017.97
8.2.70.0000.00817.80
8.2.60.0050.00218.03
8.2.50.0000.00818.10
8.2.40.0060.00320.58
8.2.30.0070.00019.14
8.2.20.0020.00518.00
8.2.10.0040.00419.28
8.2.00.0000.00719.39
8.1.330.0080.00222.20
8.1.320.0160.00416.09
8.1.310.0180.00016.71
8.1.300.0060.00316.01
8.1.290.0080.00018.88
8.1.280.0090.00925.92
8.1.270.0050.00323.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0070.00422.07
8.1.230.0060.00622.64
8.1.220.0040.00417.77
8.1.210.0040.00418.77
8.1.200.0030.00617.23
8.1.190.0080.00417.23
8.1.180.0050.00318.10
8.1.170.0000.00818.71
8.1.160.0030.00518.78
8.1.150.0070.00018.88
8.1.140.0040.00418.89
8.1.130.0000.00717.42
8.1.120.0000.00817.45
8.1.110.0080.00017.50
8.1.100.0060.00317.51
8.1.90.0040.00417.42
8.1.80.0090.00017.48
8.1.70.0070.00017.35
8.1.60.0040.00417.62
8.1.50.0070.00017.42
8.1.40.0050.00317.47
8.1.30.0000.00917.66
8.1.20.0040.00417.51
8.1.10.0040.00417.40
8.1.00.0040.00417.48
8.0.300.0050.00219.52
8.0.290.0040.00416.75
8.0.280.0030.00318.41
8.0.270.0030.00317.20
8.0.260.0000.00716.84
8.0.250.0030.00316.96
8.0.240.0030.00316.88
8.0.230.0070.00016.99
8.0.220.0060.00316.90
8.0.210.0030.00316.87
8.0.200.0060.00017.01
8.0.190.0000.00716.96
8.0.180.0030.00316.94
8.0.170.0100.00016.95
8.0.160.0040.00416.92
8.0.150.0030.00616.87
8.0.140.0040.00416.87
8.0.130.0030.00313.27
8.0.120.0000.00716.91
8.0.110.0040.00416.96
8.0.100.0040.00416.79
8.0.90.0030.00516.72
8.0.80.0080.01216.89
8.0.70.0040.00416.88
8.0.60.0000.00816.86
8.0.50.0040.00416.69
8.0.30.0070.01116.99
8.0.20.0120.00617.01
8.0.10.0080.00016.84
8.0.00.0130.00616.92
7.4.330.0030.00315.55
7.4.320.0000.00616.35
7.4.300.0000.00616.56
7.4.290.0070.00016.45
7.4.280.0030.00516.43
7.4.270.0000.00716.60
7.4.260.0050.00216.60
7.4.250.0050.00316.50
7.4.240.0050.00216.53
7.4.230.0000.00716.39
7.4.220.0030.00516.50
7.4.210.0070.01316.57
7.4.200.0070.00016.40
7.4.160.0070.01016.56
7.4.130.0120.00916.73
7.4.120.0160.01016.56
7.4.110.0160.00816.66
7.4.100.0100.01016.63
7.4.90.0040.01216.50
7.4.80.0030.01719.39
7.4.70.0130.00316.69
7.4.60.0100.00716.57
7.4.50.0000.01116.36
7.4.40.0060.01216.66
7.4.00.0090.00715.00
7.3.330.0050.00013.27
7.3.320.0030.00313.31
7.3.310.0000.00716.41
7.3.300.0070.00016.31
7.3.290.0000.00716.36
7.3.280.0120.00316.23
7.3.260.0100.01016.51
7.3.240.0120.00616.52
7.3.230.0030.01616.55
7.3.210.0070.01716.60
7.3.200.0060.00916.43
7.3.190.0060.00916.48
7.3.180.0130.00316.46
7.3.170.0070.01116.46
7.3.160.0040.01416.35
7.3.120.0110.00714.59
7.3.110.0080.01014.47
7.3.100.0050.01114.91
7.3.90.0040.00914.77
7.3.80.0080.00814.89
7.3.70.0050.00714.96
7.3.60.0070.00814.95
7.3.50.0050.00814.86
7.3.40.0090.00914.81
7.3.30.0090.00514.72
7.3.20.0060.01016.65
7.3.10.0080.01016.58
7.3.00.0080.00616.57
7.2.330.0090.01416.70
7.2.320.0120.00616.66
7.2.310.0100.00616.68
7.2.300.0030.01416.49
7.2.290.0100.01316.34
7.2.250.0070.01215.19
7.2.240.0070.01115.10
7.2.230.0090.00714.95
7.2.220.0070.00515.05
7.2.210.0050.01014.95
7.2.200.0060.00814.99
7.2.190.0060.00715.00
7.2.180.0050.00915.05
7.2.170.0090.00715.03
7.2.160.0110.00015.02
7.2.150.0030.01016.95
7.2.140.0100.00616.78
7.2.130.0070.00716.76
7.2.120.0000.01416.92
7.2.110.0090.00616.96
7.2.100.0030.01716.84
7.2.90.0120.00316.86
7.2.80.0150.00016.79
7.2.70.0070.00716.88
7.2.60.0130.00316.86
7.2.50.0130.00916.61
7.2.40.0080.01116.74
7.2.30.0090.00616.91
7.2.20.0080.00716.75
7.2.10.0040.01116.59
7.2.00.0060.00916.85
7.1.330.0090.00515.63
7.1.320.0110.00315.52
7.1.310.0020.00915.55
7.1.300.0090.00515.70
7.1.290.0050.00815.83
7.1.280.0060.00615.62
7.1.270.0080.00715.57
7.1.260.0050.01015.73
7.1.250.0070.00715.54

preferences:
30.1 ms | 403 KiB | 5 Q