3v4l.org

run code in 300+ PHP versions simultaneously
<?php function array_replace_keys($array, $keys) { print_r($keys);die; foreach ($keys as $search => $replace) { if ( isset($array[$search])) { $array[$replace] = $array[$search]; unset($array[$search]); } } return $array; } $var = '[{"player":"Tiger Woods"},{"player":"Gary Player"}]'; $temp = json_decode($var, true); foreach($temp as $k => &$v){ $v = array_combine(['golfer'], $v); } 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.0150.00819.92
8.4.150.0010.00114.05
8.4.140.0130.00917.64
8.4.130.0150.00617.82
8.4.120.0120.00720.59
8.4.110.0050.00620.45
8.4.100.0030.00517.79
8.4.90.0120.00822.32
8.4.80.0040.00520.64
8.4.70.0060.00218.86
8.4.60.0130.00720.54
8.4.50.0100.01118.58
8.4.40.0140.00319.23
8.4.30.0100.00922.48
8.4.20.0060.01320.67
8.4.10.0030.00719.37
8.3.280.0090.01118.27
8.3.270.0110.00916.32
8.3.260.0090.00716.57
8.3.250.0130.00818.96
8.3.240.0120.00816.54
8.3.230.0120.00616.50
8.3.220.0080.00818.97
8.3.210.0110.00816.64
8.3.200.0070.00616.55
8.3.190.0030.00418.97
8.3.180.0060.01319.13
8.3.170.0120.00617.16
8.3.160.0150.00316.48
8.3.150.0100.01018.84
8.3.140.0140.00018.88
8.3.130.0030.00618.46
8.3.120.0130.00618.83
8.3.110.0050.00520.94
8.3.100.0100.01024.06
8.3.90.0110.00318.31
8.3.80.0000.00918.56
8.3.70.0110.00716.49
8.3.60.0070.01018.43
8.3.50.0090.01017.18
8.3.40.0130.00618.71
8.3.30.0070.00718.59
8.3.20.0050.00321.85
8.3.10.0040.00421.82
8.3.00.0020.00523.70
8.2.290.0170.00316.66
8.2.280.0130.00618.42
8.2.270.0100.01016.51
8.2.260.0030.00516.89
8.2.250.0040.00416.75
8.2.240.0090.00017.44
8.2.230.0100.00622.58
8.2.220.0000.00837.54
8.2.210.0120.00326.77
8.2.200.0060.00318.16
8.2.190.0060.01216.58
8.2.180.0070.01016.63
8.2.170.0070.00722.96
8.2.160.0100.00321.14
8.2.150.0060.00324.18
8.2.140.0000.00924.66
8.2.130.0040.00426.16
8.2.120.0040.00426.16
8.2.110.0090.00022.28
8.2.100.0090.00319.45
8.2.90.0050.00317.50
8.2.80.0000.00918.67
8.2.70.0050.00317.50
8.2.60.0040.00417.80
8.2.50.0080.00018.07
8.2.40.0000.00818.35
8.2.30.0040.00418.16
8.2.20.0040.00417.99
8.2.10.0030.00519.37
8.2.00.0040.00419.35
8.1.330.0120.00616.20
8.1.320.0110.00417.88
8.1.310.0000.00716.69
8.1.300.0090.00017.70
8.1.290.0110.00018.88
8.1.280.0100.00325.92
8.1.270.0030.00623.85
8.1.260.0050.00226.35
8.1.250.0040.00428.09
8.1.240.0040.00418.90
8.1.230.0060.00617.64
8.1.220.0080.00017.79
8.1.210.0000.00818.77
8.1.200.0030.00617.23
8.1.190.0080.00017.35
8.1.180.0000.00918.10
8.1.170.0060.00318.74
8.1.160.0000.00718.90
8.1.150.0040.00418.88
8.1.140.0000.00718.86
8.1.130.0050.00220.05
8.1.120.0000.00717.49
8.1.110.0040.00417.47
8.1.100.0070.00017.36
8.1.90.0060.00617.49
8.1.80.0040.00417.35
8.1.70.0040.00417.45
8.1.60.0040.00417.63
8.1.50.0050.00217.54
8.1.40.0060.00317.54
8.1.30.0070.00017.63
8.1.20.0000.00817.56
8.1.10.0040.00417.36
8.1.00.0080.00017.34
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0000.00718.35
8.0.270.0030.00317.14
8.0.260.0030.00318.46
8.0.250.0020.00516.96
8.0.240.0090.00016.94
8.0.230.0000.00716.80
8.0.220.0060.00316.94
8.0.210.0050.00216.89
8.0.200.0030.00316.96
8.0.190.0000.00716.94
8.0.180.0000.00816.82
8.0.170.0040.00416.94
8.0.160.0040.00416.93
8.0.150.0000.00716.89
8.0.140.0070.00016.86
8.0.130.0000.00613.23
8.0.120.0040.00416.77
8.0.110.0050.00216.96
8.0.100.0040.00316.77
8.0.90.0030.00516.96
8.0.80.0040.01216.95
8.0.70.0000.00716.96
8.0.60.0000.00716.84
8.0.50.0040.00316.87
8.0.30.0100.00717.09
8.0.20.0090.01117.06
8.0.10.0040.00417.14
8.0.00.0110.00916.76
7.4.330.0020.00215.55
7.4.320.0000.00616.65
7.4.300.0060.00016.36
7.4.290.0030.00616.49
7.4.280.0040.00416.45
7.4.270.0000.00716.52
7.4.260.0030.00316.43
7.4.250.0030.00316.48
7.4.240.0030.00316.59
7.4.230.0000.00716.42
7.4.220.0040.00416.65
7.4.210.0100.00716.52
7.4.200.0040.00416.71
7.4.160.0090.00716.51
7.4.140.0130.00317.86
7.4.130.0090.01316.63
7.4.120.0110.00716.44
7.4.110.0100.00716.34
7.4.100.0060.00916.27
7.4.90.0120.00616.53
7.4.80.0190.00619.39
7.4.70.0060.01016.52
7.4.60.0090.00616.43
7.4.50.0060.01016.63
7.4.40.0040.01316.55
7.4.00.0090.00314.95
7.3.330.0050.00013.27
7.3.320.0000.00613.33
7.3.310.0000.00616.34
7.3.300.0060.00016.25
7.3.290.0000.00716.24
7.3.280.0070.00816.27
7.3.260.0090.00916.42
7.3.240.0070.01016.52
7.3.230.0130.00916.56
7.3.210.0090.00916.21
7.3.200.0120.00416.49
7.3.190.0070.01416.59
7.3.180.0060.00916.28
7.3.170.0090.00616.31
7.3.160.0070.01016.54
7.3.60.0070.01414.71
7.3.50.0060.00614.80
7.3.40.0070.00714.79
7.3.30.0140.00714.55
7.3.20.0070.00716.53
7.3.10.0070.00416.83
7.3.00.0070.00416.63
7.2.330.0050.01316.70
7.2.320.0140.00316.81
7.2.310.0140.00316.75
7.2.300.0070.01116.79
7.2.290.0130.00716.53
7.2.190.0120.00914.92
7.2.180.0150.00414.71
7.2.170.0090.01214.80
7.2.160.0090.00914.93
7.2.150.0080.00416.98
7.2.140.0110.00316.76
7.2.130.0090.00316.82
7.2.120.0070.00716.96
7.2.110.0160.00316.62
7.2.100.0060.00616.98
7.2.90.0100.00316.72
7.2.80.0040.00716.89
7.2.70.0030.00816.98
7.2.60.0070.00416.97
7.2.50.0140.00316.96
7.2.40.0000.01116.78
7.2.30.0000.01116.95
7.2.20.0030.00716.52
7.2.10.0100.01016.79
7.2.00.0130.00016.93
7.1.300.0100.01315.81
7.1.290.0080.01215.73
7.1.280.0090.01215.67
7.1.270.0060.00615.41
7.1.260.0040.00715.41
7.1.250.0070.01115.74

preferences:
31.58 ms | 403 KiB | 5 Q