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); $temp = array_map(function($item){ return array_combine(['golfer'], $item); }, $temp); 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.0110.01219.83
8.4.150.0020.00114.05
8.4.140.0130.00917.32
8.4.130.0130.00717.64
8.4.120.0110.00620.32
8.4.110.0150.00622.27
8.4.100.0120.01017.72
8.4.90.0140.00620.64
8.4.80.0060.00420.84
8.4.70.0110.00519.03
8.4.60.0100.01020.43
8.4.50.0070.00318.54
8.4.40.0120.00919.36
8.4.30.0130.00622.25
8.4.20.0130.00620.68
8.4.10.0030.00619.41
8.3.280.0130.00818.29
8.3.270.0140.00616.72
8.3.260.0100.00916.75
8.3.250.0110.00718.79
8.3.240.0060.00916.97
8.3.230.0150.00516.40
8.3.220.0090.00920.67
8.3.210.0110.00716.49
8.3.200.0060.00316.55
8.3.190.0080.01018.71
8.3.180.0120.00718.55
8.3.170.0090.00617.22
8.3.160.0060.01216.46
8.3.150.0110.00416.74
8.3.140.0040.00418.81
8.3.130.0040.00418.29
8.3.120.0040.00418.89
8.3.110.0030.00620.94
8.3.100.0000.00724.06
8.3.90.0040.00426.77
8.3.80.0030.00718.30
8.3.70.0150.00318.43
8.3.60.0060.00918.30
8.3.50.0070.01218.20
8.3.40.0090.00618.71
8.3.30.0140.00018.59
8.3.20.0070.00021.90
8.3.10.0040.00421.79
8.3.00.0040.00423.63
8.2.290.0090.00720.46
8.2.280.0100.00818.97
8.2.270.0040.01416.73
8.2.260.0040.00416.97
8.2.250.0000.00817.08
8.2.240.0030.00618.91
8.2.230.0070.00422.58
8.2.220.0060.00337.54
8.2.210.0110.00426.77
8.2.200.0090.00318.00
8.2.190.0170.00316.58
8.2.180.0080.01216.50
8.2.170.0140.00322.96
8.2.160.0110.00321.10
8.2.150.0120.00325.66
8.2.140.0040.00424.66
8.2.130.0000.00826.16
8.2.120.0040.00426.16
8.2.110.0030.00622.07
8.2.100.0030.00917.90
8.2.90.0040.00417.75
8.2.80.0080.00017.97
8.2.70.0040.00417.99
8.2.60.0080.00018.09
8.2.50.0000.00818.10
8.2.40.0000.00720.36
8.2.30.0040.00419.21
8.2.20.0040.00418.05
8.2.10.0050.00219.41
8.2.00.0050.00319.18
8.1.330.0100.00922.09
8.1.320.0130.00523.86
8.1.310.0140.00016.76
8.1.300.0090.00918.38
8.1.290.0090.00018.88
8.1.280.0100.00725.92
8.1.270.0000.00823.96
8.1.260.0030.00326.35
8.1.250.0030.00628.09
8.1.240.0000.00919.20
8.1.230.0070.00319.07
8.1.220.0030.00517.74
8.1.210.0030.00518.77
8.1.200.0030.00617.47
8.1.190.0050.00317.23
8.1.180.0050.00318.10
8.1.170.0000.00818.64
8.1.160.0000.00718.89
8.1.150.0020.00518.79
8.1.140.0000.00718.83
8.1.130.0030.00320.13
8.1.120.0040.00417.39
8.1.110.0000.00817.38
8.1.100.0030.00517.48
8.1.90.0000.01017.47
8.1.80.0000.00817.47
8.1.70.0000.00717.50
8.1.60.0050.00317.64
8.1.50.0030.00617.41
8.1.40.0060.00317.54
8.1.30.0040.00417.68
8.1.20.0030.00517.57
8.1.10.0040.00417.46
8.1.00.0000.00817.43
8.0.300.0040.00421.87
8.0.290.0070.00016.75
8.0.280.0030.00318.26
8.0.270.0000.00717.11
8.0.260.0060.00018.42
8.0.250.0070.00016.76
8.0.240.0030.00616.90
8.0.230.0000.00716.75
8.0.220.0050.00316.79
8.0.210.0040.00416.70
8.0.200.0000.00816.98
8.0.190.0050.00316.98
8.0.180.0000.00716.95
8.0.170.0000.00916.92
8.0.160.0040.00416.88
8.0.150.0030.00616.83
8.0.140.0040.00416.75
8.0.130.0030.00313.30
8.0.120.0040.00416.83
8.0.110.0040.00416.95
8.0.100.0000.00716.70
8.0.90.0000.00916.82
8.0.80.0120.00316.85
8.0.70.0000.00716.86
8.0.60.0050.00216.71
8.0.50.0000.00716.70
8.0.30.0070.01017.13
8.0.20.0100.01017.09
8.0.10.0040.00417.05
8.0.00.0140.00816.74
7.4.330.0000.00515.55
7.4.320.0020.00516.51
7.4.300.0030.00316.41
7.4.290.0050.00216.56
7.4.280.0040.00416.58
7.4.270.0000.00716.50
7.4.260.0070.00016.48
7.4.250.0000.00716.47
7.4.240.0020.00616.51
7.4.230.0040.00416.34
7.4.220.0050.00316.65
7.4.210.0050.00916.50
7.4.200.0070.00016.56
7.4.140.0060.01317.86
7.4.130.0170.01416.41
7.4.120.0130.00416.50
7.4.110.0130.00616.45
7.4.100.0090.00916.53
7.4.90.0160.00316.54
7.4.80.0160.00019.39
7.4.70.0060.01016.43
7.4.60.0030.01316.48
7.4.50.0000.01316.35
7.4.40.0080.00816.46
7.4.00.0110.00714.74
7.3.330.0030.00313.08
7.3.320.0050.00013.11
7.3.310.0030.00316.24
7.3.300.0000.00816.12
7.3.290.0030.00316.13
7.3.280.0180.00916.23
7.3.260.0110.00816.37
7.3.240.0090.00816.42
7.3.230.0060.01216.32
7.3.210.0030.01316.34
7.3.200.0100.01016.45
7.3.190.0100.00616.39
7.3.180.0070.01016.21
7.3.170.0080.00816.21
7.3.160.0000.01716.42
7.3.120.0030.01314.47
7.3.110.0070.01014.60
7.3.100.0060.00914.43
7.3.90.0100.00714.69
7.3.80.0100.00714.91
7.3.70.0030.00914.66
7.3.60.0030.01214.83
7.3.50.0060.00614.53
7.3.40.0100.00514.55
7.3.30.0030.01014.58
7.3.20.0050.01016.39
7.3.10.0090.00316.60
7.3.00.0080.00716.48
7.2.330.0110.00816.66
7.2.320.0100.01616.41
7.2.310.0100.01316.66
7.2.300.0080.00816.57
7.2.290.0150.00316.60
7.2.250.0160.00014.95
7.2.240.0070.01015.20
7.2.230.0090.00915.14
7.2.220.0040.01214.89
7.2.210.0080.00814.73
7.2.200.0040.00815.02
7.2.190.0100.00414.94
7.2.180.0020.01214.85
7.2.170.0070.00514.90
7.2.160.0100.00314.84
7.2.150.0090.00616.81
7.2.140.0100.00616.78
7.2.130.0040.01116.96
7.2.120.0030.01316.64
7.2.110.0040.01316.77
7.2.100.0040.01116.84
7.2.90.0080.00416.77
7.2.80.0040.00816.79
7.2.70.0000.01516.77
7.2.60.0090.00616.95
7.2.50.0090.00616.94
7.2.40.0060.00916.86
7.2.30.0080.00816.96
7.2.20.0090.00316.58
7.2.10.0130.00316.59
7.2.00.0100.00616.80
7.1.330.0100.00315.73
7.1.320.0070.01015.58
7.1.310.0030.00616.04
7.1.300.0090.00615.60
7.1.290.0060.00915.62
7.1.280.0050.00815.72
7.1.270.0100.00715.43
7.1.260.0070.00715.77
7.1.250.0030.01015.68

preferences:
29.62 ms | 403 KiB | 5 Q