3v4l.org

run code in 300+ PHP versions simultaneously
<?php function array_replace_key($search, $replace, array $target) { $return = array(); foreach ($target as $key => $val) { if ($search === $key) { $return[$replace] = $val; } else { $return[$key] = $val; } } return $return; } $a = array('a' => 'franz', 'b' => 'cheryl', 'c' => 'samantha'); var_dump(array_replace_key('a', 'a-xxx', $a));

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.0200.00018.56
8.3.50.0090.01121.15
8.3.40.0170.00318.70
8.3.30.0170.00020.33
8.3.20.0040.00420.29
8.3.10.0080.00022.04
8.3.00.0040.00422.48
8.2.180.0030.01218.41
8.2.170.0090.00922.96
8.2.160.0070.00720.52
8.2.150.0040.00424.18
8.2.140.0180.00424.66
8.2.130.0180.00026.16
8.2.120.0040.00419.80
8.2.110.0030.00622.27
8.2.100.0110.00019.28
8.2.90.0030.00619.35
8.2.80.0040.00419.30
8.2.70.0060.00317.75
8.2.60.0000.00818.16
8.2.50.0000.00818.07
8.2.40.0040.00418.16
8.2.30.0040.00418.00
8.2.20.0040.00417.83
8.2.10.0070.00017.78
8.2.00.0070.00017.75
8.1.280.0140.00725.92
8.1.270.0080.00024.66
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0090.00023.88
8.1.230.0080.00419.20
8.1.220.0080.00017.74
8.1.210.0060.00618.77
8.1.200.0030.00617.35
8.1.190.0000.00717.43
8.1.180.0000.00920.20
8.1.170.0000.00818.58
8.1.160.0050.00222.05
8.1.150.0040.00418.62
8.1.140.0030.00517.46
8.1.130.0030.00317.77
8.1.120.0040.00417.39
8.1.110.0040.00417.34
8.1.100.0000.00817.36
8.1.90.0040.00417.34
8.1.80.0000.00717.48
8.1.70.0040.00417.36
8.1.60.0060.00317.55
8.1.50.0000.00817.55
8.1.40.0000.00817.39
8.1.30.0000.00717.68
8.1.20.0000.00817.69
8.1.10.0030.00617.47
8.1.00.0050.00317.52
8.0.300.0000.00718.77
8.0.290.0070.00017.18
8.0.280.0030.00318.35
8.0.270.0000.00717.26
8.0.260.0000.00716.77
8.0.250.0060.00016.93
8.0.240.0000.00716.94
8.0.230.0070.00016.93
8.0.220.0000.00816.91
8.0.210.0000.00716.89
8.0.200.0040.00416.90
8.0.190.0060.00616.85
8.0.180.0040.00416.90
8.0.170.0050.00316.91
8.0.160.0050.00316.77
8.0.150.0030.00316.80
8.0.140.0040.00416.78
8.0.130.0030.00313.30
8.0.120.0040.00416.92
8.0.110.0040.00416.86
8.0.100.0040.00416.74
8.0.90.0070.00016.81
8.0.80.0090.01216.80
8.0.70.0030.00516.85
8.0.60.0050.00316.79
8.0.50.0000.00816.78
8.0.30.0130.01417.31
8.0.20.0090.01017.40
8.0.10.0050.00316.88
8.0.00.0070.01516.66
7.4.330.0060.00015.00
7.4.320.0030.00316.45
7.4.300.0000.00616.51
7.4.290.0030.00316.58
7.4.280.0020.00516.50
7.4.270.0030.00316.66
7.4.260.0070.00316.61
7.4.250.0000.00816.46
7.4.240.0000.00716.54
7.4.230.0000.00716.57
7.4.220.0060.01216.47
7.4.210.0090.00816.56
7.4.200.0080.00016.50
7.4.190.0040.00416.65
7.4.160.0150.00016.61
7.4.150.0120.00617.40
7.4.140.0100.01217.86
7.4.130.0120.01016.52
7.4.120.0060.01016.51
7.4.110.0180.00416.28
7.4.100.0110.00616.55
7.4.90.0090.00916.44
7.4.80.0120.00419.39
7.4.70.0110.00816.34
7.4.60.0030.01316.57
7.4.50.0000.00916.15
7.4.40.0080.00422.77
7.4.30.0080.01116.61
7.4.00.0110.00414.96
7.3.330.0000.00513.20
7.3.320.0020.00213.31
7.3.310.0000.00716.14
7.3.300.0050.00216.30
7.3.290.0100.00716.36
7.3.280.0060.01216.35
7.3.270.0060.01217.40
7.3.260.0100.00716.38
7.3.250.0170.00316.42
7.3.240.0130.00316.38
7.3.230.0110.00616.39
7.3.210.0080.01516.41
7.3.200.0050.01419.39
7.3.190.0130.00316.29
7.3.180.0000.01716.44
7.3.170.0070.01016.41
7.3.160.0110.00416.67
7.3.120.0030.01215.07
7.2.330.0070.01316.40
7.2.320.0110.01116.41
7.2.310.0150.00816.40
7.2.300.0080.00816.78
7.2.290.0040.01216.69
7.2.00.0000.01619.17
7.1.100.0000.01618.40
7.1.70.0030.01317.01
7.1.60.0030.02219.29
7.1.50.0060.01617.14
7.1.00.0000.07022.51
7.0.200.0200.00714.99
7.0.140.0070.09022.09
7.0.60.0130.07320.06
7.0.50.0030.08017.96
7.0.40.0070.07720.27
7.0.30.0270.09020.09
7.0.20.0200.04020.05
7.0.10.0030.08720.30
7.0.00.0000.04320.07
5.6.280.0070.07021.09
5.6.210.0100.08020.71
5.6.200.0030.06018.19
5.6.190.0030.09020.33
5.6.180.0430.07720.50
5.6.170.0300.06020.52
5.6.160.0100.06020.56
5.6.150.0070.08018.15
5.6.140.0070.06718.15
5.6.130.0070.08018.16
5.6.120.0070.04021.01
5.6.110.0170.07320.99
5.6.100.0130.04020.99
5.6.90.0030.04021.02
5.6.80.0170.06720.29
5.5.350.0130.08720.53
5.5.340.0030.04017.96
5.5.330.0100.08020.47
5.5.320.0200.04320.38
5.5.310.0170.05020.23
5.5.300.0100.08017.98
5.5.290.0030.08717.98
5.5.280.0070.04020.76
5.5.270.0030.08320.75
5.5.260.0000.04320.75
5.5.250.0030.09020.66
5.5.240.0000.03320.28
5.4.450.0730.04719.74
5.4.440.0570.06719.70
5.4.430.0530.06719.57
5.4.420.0630.05319.34
5.4.410.0700.05019.17
5.4.400.0700.06019.29
5.4.390.0730.05319.16
5.4.380.0270.05318.79
5.4.370.0230.05018.82
5.4.360.0330.04718.76
5.4.350.0110.03612.02
5.4.340.0070.04512.01
5.4.320.0050.03812.51
5.4.310.0050.04712.50
5.4.300.0040.04212.50
5.4.290.0060.03912.50
5.4.280.0040.04012.40
5.4.270.0040.04112.39
5.4.260.0070.05319.02
5.4.250.0130.05019.00
5.4.240.0170.06719.02
5.4.230.0070.05318.78
5.4.220.0070.06718.96
5.4.210.0100.05018.94
5.4.200.0070.05318.74
5.4.190.0070.05319.09
5.4.180.0100.06719.09
5.4.170.0030.06318.93
5.4.160.0200.03718.88
5.4.150.0130.05318.77
5.4.140.0100.04716.36
5.4.130.0100.04716.54
5.4.120.0070.05016.45
5.4.110.0170.06316.36
5.4.100.0170.04316.52
5.4.90.0030.05716.32
5.4.80.0070.06316.45
5.4.70.0130.04316.31
5.4.60.0130.04316.46
5.4.50.0070.05016.44
5.4.40.0000.05716.41
5.4.30.0030.06316.54
5.4.20.0130.06716.46
5.4.10.0170.07716.53
5.4.00.0070.05315.89
5.3.290.0080.04212.80
5.3.280.0100.06014.61
5.3.270.0100.07714.62
5.3.260.0100.05014.68
5.3.250.0070.05014.43
5.3.240.0100.05014.68
5.3.230.0100.04714.59
5.3.220.0130.04714.72
5.3.210.0200.04314.40
5.3.200.0100.05014.64
5.3.190.0070.05014.79
5.3.180.0070.05714.72
5.3.170.0100.05314.65
5.3.160.0070.05314.74
5.3.150.0170.06314.64
5.3.140.0000.06314.62
5.3.130.0170.07014.56
5.3.120.0100.05314.56
5.3.110.0170.07014.71
5.3.100.0070.05014.21
5.3.90.0070.04714.18
5.3.80.0070.07714.24
5.3.70.0100.04714.24
5.3.60.0030.05314.08
5.3.50.0070.05014.06
5.3.40.0170.04014.04
5.3.30.0200.05713.81
5.3.20.0030.05313.68
5.3.10.0070.05013.82
5.3.00.0100.05013.64
5.2.170.0070.04311.14
5.2.160.0070.04011.14
5.2.150.0030.04711.33
5.2.140.0000.05711.13
5.2.130.0070.05311.28
5.2.120.0030.04711.10
5.2.110.0070.04311.10
5.2.100.0000.04711.25
5.2.90.0070.04011.23
5.2.80.0030.04011.17
5.2.70.0070.03711.18
5.2.60.0070.04311.28
5.2.50.0070.04011.21
5.2.40.0100.03710.98
5.2.30.0170.02711.04
5.2.20.0070.03711.13
5.2.10.0070.04010.93
5.2.00.0030.05010.55
5.1.60.0030.0379.99
5.1.50.0070.0439.96
5.1.40.0200.0239.93
5.1.30.0100.03010.16
5.1.20.0170.04310.25
5.1.10.0070.0339.90
5.1.00.0030.0379.98
5.0.50.0000.0308.55
5.0.40.0070.0238.45
5.0.30.0030.0408.41
5.0.20.0130.0178.23
5.0.10.0070.0238.32
5.0.00.0030.0408.25
4.4.90.0000.0237.42
4.4.80.0000.0237.42
4.4.70.0100.0137.42
4.4.60.0000.0277.42
4.4.50.0000.0237.42
4.4.40.0000.0337.42
4.4.30.0000.0337.42
4.4.20.0070.0277.42
4.4.10.0130.0107.42
4.4.00.0070.0307.42
4.3.110.0100.0137.42
4.3.100.0000.0237.42
4.3.90.0030.0177.42
4.3.80.0030.0307.41
4.3.70.0000.0237.41
4.3.60.0070.0237.41
4.3.50.0000.0237.41
4.3.40.0070.0307.41
4.3.30.0030.0207.41
4.3.20.0030.0277.41
4.3.10.0070.0177.41
4.3.00.0200.0208.52

preferences:
40.05 ms | 401 KiB | 5 Q