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 && array_key_exists($replace, $target) === false) { $return[$replace] = $val; } else { $return[$key] = $val; } } return $return; } $a = array('a' => 'franz', 'b' => 'cheryl', 'c' => 'samantha'); var_dump(array_replace_key('a', 'b', $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.40.0040.01118.97
8.3.30.0070.00719.27
8.3.20.0050.00220.24
8.3.10.0040.00422.14
8.3.00.0050.00322.46
8.2.170.0110.00422.96
8.2.160.0110.00320.90
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0070.00726.16
8.2.120.0080.00019.36
8.2.110.0060.00322.11
8.2.100.0070.00419.45
8.2.90.0040.00419.34
8.2.80.0000.00818.05
8.2.70.0030.00617.75
8.2.60.0000.00818.03
8.2.50.0090.00018.07
8.2.40.0080.00018.12
8.2.30.0040.00418.22
8.2.20.0040.00417.62
8.2.10.0030.00517.75
8.2.00.0000.00817.68
8.1.270.0050.00322.02
8.1.260.0070.00026.35
8.1.250.0070.00028.09
8.1.240.0060.00323.83
8.1.230.0030.00719.10
8.1.220.0080.00017.74
8.1.210.0060.00318.77
8.1.200.0070.00317.47
8.1.190.0040.00417.66
8.1.180.0040.00418.74
8.1.170.0060.00318.50
8.1.160.0000.00722.02
8.1.150.0000.00818.61
8.1.140.0070.00317.46
8.1.130.0040.00417.67
8.1.120.0050.00217.55
8.1.110.0070.00017.41
8.1.100.0040.00417.45
8.1.90.0030.00317.44
8.1.80.0030.00317.40
8.1.70.0000.00817.37
8.1.60.0000.01217.60
8.1.50.0000.00717.54
8.1.40.0000.00717.42
8.1.30.0000.00817.57
8.1.20.0000.00817.68
8.1.10.0060.00317.61
8.1.00.0050.00317.54
8.0.300.0050.00318.77
8.0.290.0000.00716.93
8.0.280.0000.00718.46
8.0.270.0040.00417.39
8.0.260.0030.00316.78
8.0.250.0040.00417.03
8.0.240.0040.00416.88
8.0.230.0000.00716.96
8.0.220.0070.00016.91
8.0.210.0030.00316.87
8.0.200.0000.00716.91
8.0.190.0080.00016.89
8.0.180.0040.00416.83
8.0.170.0040.00416.82
8.0.160.0000.00716.81
8.0.150.0000.00716.74
8.0.140.0000.00716.75
8.0.130.0000.00613.36
8.0.120.0080.00016.82
8.0.110.0000.00716.82
8.0.100.0020.00516.79
8.0.90.0050.00316.85
8.0.80.0070.01116.95
8.0.70.0040.00416.86
8.0.60.0040.00416.78
8.0.50.0050.00316.96
8.0.30.0100.01017.20
8.0.20.0130.00517.40
8.0.10.0000.00716.93
8.0.00.0090.00916.70
7.4.330.0020.00215.00
7.4.320.0000.00616.59
7.4.300.0000.00616.56
7.4.290.0100.00016.41
7.4.280.0060.00316.59
7.4.270.0030.00416.52
7.4.260.0000.00716.57
7.4.250.0040.00416.43
7.4.240.0070.00016.54
7.4.230.0040.00416.68
7.4.220.0070.01116.47
7.4.210.0120.00516.55
7.4.200.0030.00316.54
7.4.190.0030.00316.65
7.4.160.0090.00616.47
7.4.150.0100.00717.40
7.4.140.0110.01117.86
7.4.130.0080.01016.58
7.4.120.0090.01116.56
7.4.110.0110.00516.64
7.4.100.0130.00416.42
7.4.90.0110.00716.41
7.4.80.0100.01019.39
7.4.70.0100.00716.59
7.4.60.0100.01016.57
7.4.50.0030.00516.29
7.4.40.0140.00022.77
7.4.30.0100.00716.47
7.4.00.0110.00415.05
7.3.330.0050.00013.38
7.3.320.0000.00613.44
7.3.310.0040.00416.40
7.3.300.0030.00316.29
7.3.290.0070.00716.46
7.3.280.0080.00716.33
7.3.270.0130.00317.40
7.3.260.0100.00716.32
7.3.250.0130.00416.30
7.3.240.0070.01016.59
7.3.230.0160.00916.39
7.3.210.0090.00916.36
7.3.200.0070.01016.54
7.3.190.0060.00916.68
7.3.180.0090.00616.54
7.3.170.0120.00416.45
7.3.160.0180.00316.45
7.3.120.0120.00315.10
7.3.00.0090.00316.75
7.2.330.0140.00316.43
7.2.320.0100.00716.71
7.2.310.0080.00816.69
7.2.300.0070.01016.59
7.2.290.0140.00316.61
7.2.130.0030.00917.01
7.2.120.0030.01016.89
7.2.110.0000.01016.69
7.2.100.0030.01316.84
7.2.90.0110.00716.89
7.2.80.0030.01016.86
7.2.70.0110.00716.67
7.2.60.0060.01016.95
7.2.50.0100.00616.91
7.2.40.0060.00616.99
7.2.30.0070.01016.95
7.2.20.0000.01416.74
7.2.10.0140.00316.87
7.2.00.0060.00918.16
7.1.250.0030.01315.64
7.1.240.0060.00615.70
7.1.230.0040.00815.69
7.1.220.0060.00315.70
7.1.210.0070.00715.72
7.1.200.0030.00615.78
7.1.190.0060.00615.88
7.1.180.0030.00515.92
7.1.170.0060.00915.74
7.1.160.0030.00715.51
7.1.150.0060.00615.89
7.1.140.0030.01015.69
7.1.130.0030.01015.56
7.1.120.0080.00315.64
7.1.110.0070.00715.95
7.1.100.0130.00815.84
7.1.90.0050.00315.90
7.1.80.0040.00415.89
7.1.70.0020.00916.54
7.1.60.0050.01217.90
7.1.50.0040.00816.25
7.1.40.0040.00715.86
7.1.30.0090.00015.99
7.1.20.0090.00615.64
7.1.10.0110.00815.59
7.1.00.0040.03719.17
7.0.330.0100.00615.41
7.0.320.0100.00315.44
7.0.310.0040.01115.43
7.0.300.0000.01515.42
7.0.290.0070.00715.11
7.0.280.0030.01015.44
7.0.270.0080.00415.25
7.0.260.0000.01215.46
7.0.250.0030.01215.64
7.0.240.0090.00615.57
7.0.230.0000.00815.34
7.0.220.0040.01115.22
7.0.210.0070.00715.29
7.0.200.0020.00916.07
7.0.190.0060.00315.64
7.0.180.0060.01015.53
7.0.170.0030.01015.57
7.0.160.0040.00715.41
7.0.150.0070.00715.33
7.0.140.0100.03518.67
7.0.130.0030.00615.29
7.0.120.0040.01115.16
7.0.110.0050.04617.75
7.0.100.0090.03817.71
7.0.90.0030.04717.65
7.0.80.0080.04317.80
7.0.70.0050.04417.60
7.0.60.0080.04117.63
7.0.50.0140.03518.00
7.0.40.0090.04216.72
7.0.30.0050.04316.86
7.0.20.0110.04116.72
7.0.10.0090.04216.75
7.0.00.0120.04216.92
5.6.380.0000.01314.27
5.6.370.0130.00014.75
5.6.360.0070.00714.30
5.6.350.0030.00613.90
5.6.340.0080.00414.60
5.6.330.0070.01014.30
5.6.320.0030.00714.44
5.6.310.0060.00914.61
5.6.300.0030.01014.31
5.6.290.0110.00414.43
5.6.280.0050.04217.84
5.6.270.0000.01214.43
5.6.260.0100.03817.60
5.6.250.0030.04217.47
5.6.240.0030.05217.46
5.6.230.0080.04017.44
5.6.220.0070.04417.50
5.6.210.0070.04217.55
5.6.200.0110.04017.67
5.6.190.0050.04317.60
5.6.180.0060.04317.86
5.6.170.0100.04317.66
5.6.160.0070.04417.88
5.6.150.0100.03717.58
5.6.140.0050.04617.76
5.6.130.0110.04117.84
5.6.120.0060.02317.76
5.6.110.0030.03717.95
5.6.100.0110.02417.66
5.6.90.0100.03817.65
5.6.80.0020.03017.26
5.6.70.0110.04117.58
5.6.60.0080.03217.40
5.6.50.0030.04317.38
5.6.40.0030.03217.42
5.6.30.0090.04017.30
5.6.20.0100.03817.30
5.6.10.0100.03817.28
5.6.00.0030.04317.40
5.5.380.0100.03515.96
5.5.370.0050.04316.00
5.5.360.0090.04015.86
5.5.350.0050.04215.92
5.5.340.0050.04316.04
5.5.330.0050.04616.01
5.5.320.0080.04516.13
5.5.310.0070.04016.16
5.5.300.0060.04016.08
5.5.290.0100.03716.02
5.5.280.0050.04216.09
5.5.270.0080.03816.19
5.5.260.0060.03815.96
5.5.250.0110.02515.87
5.5.240.0070.03815.78
5.5.230.0110.04015.63
5.5.220.0000.04615.78
5.5.210.0100.02215.61
5.5.200.0100.03515.60
5.5.190.0120.03715.54
5.5.180.0030.04715.72
5.5.170.0050.00211.28
5.5.160.0070.03415.82
5.5.150.0070.03915.61
5.5.140.0040.03915.75
5.5.130.0020.04015.79
5.5.120.0060.03815.82
5.5.110.0020.03215.70
5.5.100.0090.03615.61
5.5.90.0050.04115.61
5.5.80.0070.03715.61
5.5.70.0080.03815.52
5.5.60.0050.03915.52
5.5.50.0050.04115.74
5.5.40.0080.03815.63
5.5.30.0050.04115.63
5.5.20.0030.04615.66
5.5.10.0100.04115.56
5.5.00.0060.02515.69
5.4.450.0040.04515.38
5.4.440.0100.04015.22
5.4.430.0030.04015.24
5.4.420.0020.02715.32
5.4.410.0110.03415.27
5.4.400.0030.04415.13
5.4.390.0060.03815.07
5.4.380.0080.04014.97
5.4.370.0060.03614.91
5.4.360.0070.04215.02
5.4.350.0050.04315.10
5.4.340.0080.03915.13
5.4.330.0030.00511.09
5.4.320.0030.03815.01
5.4.310.0030.03014.99
5.4.300.0150.02014.92
5.4.290.0020.04415.18
5.4.280.0050.04215.19
5.4.270.0080.03715.14
5.4.260.0070.04015.11
5.4.250.0000.02715.08
5.4.240.0060.03314.93
5.4.230.0070.02515.09
5.4.220.0080.03314.99
5.4.210.0120.03515.27
5.4.200.0090.03614.88
5.4.190.0040.04315.10
5.4.180.0090.03315.14
5.4.170.0060.03515.14
5.4.160.0000.03015.02
5.4.150.0070.03815.05
5.4.140.0070.03713.82
5.4.130.0130.03213.85
5.4.120.0020.04313.75
5.4.110.0050.03313.77
5.4.100.0110.03313.88
5.4.90.0080.03513.95
5.4.80.0030.04013.80
5.4.70.0050.04013.72
5.4.60.0070.03513.84
5.4.50.0090.03513.78
5.4.40.0120.03013.77
5.4.30.0050.04113.75
5.4.20.0050.02613.87
5.4.10.0020.02713.59
5.4.00.0030.02213.49
5.3.290.0090.03512.70
5.3.280.0030.04312.49
5.3.270.0030.05012.59
5.3.260.0100.04012.68
5.3.250.0040.03912.51
5.3.240.0110.03312.53
5.3.230.0090.03512.53
5.3.220.0050.04012.53
5.3.210.0060.02312.45
5.3.200.0030.03812.57
5.3.190.0030.02112.63
5.3.180.0080.02812.63
5.3.170.0050.02712.43
5.3.160.0030.04012.55
5.3.150.0100.03512.66
5.3.140.0060.03812.68
5.3.130.0080.02612.60
5.3.120.0050.03312.63
5.3.110.0050.01812.64
5.3.100.0030.02212.40
5.3.90.0050.01812.43
5.3.80.0080.02312.41
5.3.70.0050.02012.37
5.3.60.0030.02512.21
5.3.50.0030.02012.36
5.3.40.0070.01712.22
5.3.30.0040.02012.30
5.3.20.0020.02112.14
5.3.10.0040.01912.06
5.3.00.0030.02112.15

preferences:
38.23 ms | 400 KiB | 5 Q