3v4l.org

run code in 300+ PHP versions simultaneously
<?php function arrayReplace($a1, $a2) { foreach($a2 as $k=>$v) { $a1[$k]=$v; } return $a1; } $a1 = array(0 => 1, 1 => "b", "b" => "carrot"); $a2 = array(1 => "c", 2 => "d", "b" => "apple"); print_r(arrayReplace($a1, $a2));

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.0110.00418.59
8.3.30.0070.00718.88
8.3.20.0030.00520.26
8.3.10.0050.00323.65
8.3.00.0030.00620.90
8.2.170.0070.00722.96
8.2.160.0100.01020.52
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0150.00026.16
8.2.120.0050.00320.75
8.2.110.0040.00421.06
8.2.100.0060.00617.78
8.2.90.0000.00819.17
8.2.80.0000.00817.97
8.2.70.0040.00417.63
8.2.60.0040.00417.80
8.2.50.0080.00018.07
8.2.40.0050.00321.06
8.2.30.0000.00718.32
8.2.20.0000.00717.67
8.2.10.0040.00418.13
8.2.00.0040.00417.63
8.1.270.0030.00523.82
8.1.260.0080.00826.35
8.1.250.0100.00328.09
8.1.240.0060.00323.64
8.1.230.0060.00622.66
8.1.220.0080.00017.74
8.1.210.0000.00818.77
8.1.200.0060.00317.13
8.1.190.0040.00417.25
8.1.180.0040.00818.10
8.1.170.0080.00018.62
8.1.160.0020.00521.88
8.1.150.0030.00518.63
8.1.140.0050.00217.51
8.1.130.0030.00317.69
8.1.120.0070.00017.37
8.1.110.0050.00217.35
8.1.100.0000.00717.36
8.1.90.0040.00417.39
8.1.80.0070.00017.48
8.1.70.0040.00417.42
8.1.60.0000.00917.55
8.1.50.0030.00617.56
8.1.40.0080.00017.57
8.1.30.0050.00317.63
8.1.20.0060.00317.59
8.1.10.0050.00317.41
8.1.00.0000.00717.45
8.0.300.0000.00718.77
8.0.290.0000.00817.18
8.0.280.0000.00718.36
8.0.270.0030.00317.26
8.0.260.0060.00017.26
8.0.250.0050.00217.00
8.0.240.0070.00017.00
8.0.230.0040.00416.96
8.0.220.0070.00016.86
8.0.210.0000.00716.73
8.0.200.0000.00616.85
8.0.190.0040.00416.95
8.0.180.0070.00016.75
8.0.170.0000.00716.91
8.0.160.0000.00716.94
8.0.150.0000.00716.76
8.0.140.0040.00416.84
8.0.130.0030.00313.32
8.0.120.0050.00316.75
8.0.110.0040.00416.86
8.0.100.0000.00716.92
8.0.90.0080.00016.75
8.0.80.0110.00416.90
8.0.70.0040.00416.81
8.0.60.0040.00416.81
8.0.50.0030.00516.77
8.0.30.0080.01017.05
8.0.20.0090.00917.40
8.0.10.0040.00416.97
8.0.00.0100.01016.81
7.4.330.0020.00215.12
7.4.320.0040.00416.50
7.4.300.0000.00616.49
7.4.290.0000.00716.36
7.4.280.0000.00716.50
7.4.270.0070.00016.51
7.4.260.0000.00716.40
7.4.250.0040.00416.55
7.4.240.0050.00216.59
7.4.230.0080.00016.54
7.4.220.0070.01016.63
7.4.210.0070.00816.68
7.4.200.0080.00016.55
7.4.190.0040.00416.56
7.4.160.0110.00816.53
7.4.150.0170.00017.40
7.4.140.0090.00917.86
7.4.130.0090.00916.45
7.4.120.0080.00816.46
7.4.110.0040.01916.43
7.4.100.0100.01016.64
7.4.90.0100.00716.40
7.4.80.0060.01019.39
7.4.70.0100.00716.61
7.4.60.0030.02016.49
7.4.50.0000.00616.32
7.4.40.0030.01216.44
7.4.30.0080.00816.27
7.4.00.0110.00714.79
7.3.330.0000.00513.35
7.3.320.0000.00513.15
7.3.310.0000.00716.36
7.3.300.0030.00316.23
7.3.290.0160.00316.38
7.3.280.0070.00916.35
7.3.270.0140.00317.40
7.3.260.0100.00616.41
7.3.250.0120.00516.48
7.3.240.0030.01316.72
7.3.230.0060.01216.39
7.3.210.0090.00916.53
7.3.200.0110.00819.39
7.3.190.0110.00516.28
7.3.180.0090.00616.35
7.3.170.0080.00816.36
7.3.160.0070.00716.39
7.3.120.0080.00614.97
7.3.110.0030.00914.55
7.3.100.0000.01314.81
7.3.90.0150.00014.46
7.3.80.0030.00614.67
7.3.70.0060.01214.98
7.3.60.0070.00714.81
7.3.50.0100.00714.55
7.3.40.0030.01014.82
7.3.30.0040.00814.91
7.3.20.0090.00616.58
7.3.10.0100.00716.25
7.3.00.0000.01116.29
7.2.330.0090.00916.64
7.2.320.0060.01216.51
7.2.310.0120.00616.61
7.2.300.0130.00316.46
7.2.290.0110.00616.47
7.2.240.0060.00615.08
7.2.230.0090.00315.14
7.2.220.0000.01214.92
7.2.210.0040.01114.80
7.2.200.0040.00715.05
7.2.190.0060.00615.04
7.2.180.0030.00614.86
7.2.170.0040.00814.74
7.2.160.0050.00514.99
7.2.150.0150.00416.81
7.2.140.0040.01516.75
7.2.130.0080.00416.59
7.2.120.0030.00916.87
7.2.110.0070.00816.72
7.2.100.0060.00916.63
7.2.90.0000.01216.86
7.2.80.0130.00717.01
7.2.70.0090.00616.68
7.2.60.0040.00716.94
7.2.50.0030.01316.86
7.2.40.0070.01016.95
7.2.30.0000.01216.88
7.2.20.0070.00716.74
7.2.10.0030.01416.90
7.2.00.0060.00818.07
7.1.330.0060.00615.93
7.1.320.0070.00715.77
7.1.310.0000.01415.65
7.1.300.0090.00915.64
7.1.290.0070.00715.75
7.1.280.0070.00715.93
7.1.270.0030.01015.48
7.1.260.0070.00715.82
7.1.250.0040.01115.89
7.1.200.0080.00315.69
7.1.100.0080.00618.27
7.1.70.0030.00617.20
7.1.60.0030.00717.31
7.1.50.0100.01016.97
7.1.00.0070.07322.27
7.0.200.0060.01216.60
7.0.140.0030.07722.21
7.0.80.0130.03319.93
7.0.70.0200.03319.91
7.0.60.0070.03719.98
7.0.50.0000.04020.17
7.0.40.0070.03720.18
7.0.30.0070.03320.18
7.0.20.0130.02720.13
7.0.10.0030.03719.94
7.0.00.0000.04320.04
5.6.280.0130.06721.13
5.6.230.0000.04720.59
5.6.220.0130.03020.59
5.6.210.0030.03320.66
5.6.200.0030.03721.00
5.6.190.0100.03720.96
5.6.180.0000.03720.96
5.6.170.0100.03021.01
5.6.160.0030.04021.05
5.6.150.0070.07721.14
5.6.140.0100.05020.96
5.6.130.0100.03721.08
5.6.120.0070.07320.96
5.6.110.0030.05020.95
5.6.100.0030.08321.04
5.6.90.0130.07721.06
5.6.80.0130.06020.38
5.6.70.0070.06020.40
5.6.60.0030.07020.38
5.6.50.0100.06320.32
5.6.40.0030.04320.44
5.6.30.0070.03720.39
5.6.20.0100.05720.32
5.6.10.0030.05020.39
5.6.00.0100.04020.38
5.5.370.0000.05020.42
5.5.360.0100.03720.32
5.5.350.0030.03320.43
5.5.340.0000.04720.89
5.5.330.0030.03720.82
5.5.320.0000.03720.77
5.5.310.0030.03320.78
5.5.300.0070.06720.87
5.5.290.0100.06020.93
5.5.280.0070.03720.89
5.5.270.0030.05020.82
5.5.260.0070.05720.87
5.5.250.0070.03720.68
5.5.240.0030.03320.12
5.5.230.0030.03720.11
5.5.220.0070.08320.18
5.5.210.0130.06720.26
5.5.200.0100.05320.15
5.5.190.0030.04320.19
5.5.180.0130.03020.18
5.5.160.0030.04320.09
5.5.150.0030.06720.25
5.5.140.0070.03020.16
5.5.130.0030.06020.12
5.5.120.0030.04020.13
5.5.110.0130.07320.14
5.5.100.0030.04020.17
5.5.90.0070.07320.16
5.5.80.0100.05720.01
5.5.70.0070.05320.12
5.5.60.0200.05320.15
5.5.50.0100.02720.05
5.5.40.0100.03320.14
5.5.30.0070.04020.05
5.5.20.0200.02720.02
5.5.10.0070.07320.13
5.5.00.0070.05720.12
5.4.450.0100.03319.18
5.4.440.0070.07019.55
5.4.430.0030.07019.19
5.4.420.0030.05319.53
5.4.410.0070.04719.22
5.4.400.0170.05719.21
5.4.390.0030.04719.22
5.4.380.0100.07719.09
5.4.370.0030.03319.16
5.4.360.0070.04019.11
5.4.350.0000.04018.90
5.4.340.0070.06319.23
5.4.320.0030.08019.03
5.4.310.0070.05019.14
5.4.300.0070.07719.22
5.4.290.0030.03318.84
5.4.280.0030.05319.14
5.4.270.0130.03019.12
5.4.260.0070.05019.03
5.4.250.0100.03318.87
5.4.240.0100.06719.14
5.4.230.0100.06318.91
5.4.220.0000.04019.08
5.4.210.0030.04719.12
5.4.200.0030.04019.08
5.4.190.0030.06019.12
5.4.180.0030.03719.23
5.4.170.0130.02719.13
5.4.160.0000.03719.01
5.4.150.0100.06018.80
5.4.140.0070.03316.45
5.4.130.0170.06316.41
5.4.120.0030.05716.43
5.4.110.0030.05016.43
5.4.100.0030.04016.50
5.4.90.0070.03016.34
5.4.80.0100.06016.25
5.4.70.0030.05016.47
5.4.60.0030.03716.36
5.4.50.0070.04016.44
5.4.40.0000.06716.35
5.4.30.0030.03016.43
5.4.20.0070.05316.47
5.4.10.0030.05316.40
5.4.00.0130.05715.70
5.3.290.0070.03314.79
5.3.280.0030.04314.54
5.3.270.0030.04314.54
5.3.260.0070.04014.75
5.3.250.0100.07714.72
5.3.240.0000.08014.66
5.3.230.0070.07014.71
5.3.220.0070.08314.63
5.3.210.0000.08714.53
5.3.200.0030.03714.59
5.3.190.0070.07014.67
5.3.180.0030.07314.68
5.3.170.0030.08014.50
5.3.160.0070.07314.59
5.3.150.0030.07714.62
5.3.140.0070.02714.60
5.3.130.0070.05014.68
5.3.120.0070.07014.61
5.3.110.0000.08714.47
5.3.100.0000.03314.16
5.3.90.0030.06314.10
5.3.80.0030.06714.13
5.3.70.0100.04714.15
5.3.60.0030.04014.03
5.3.50.0070.03313.92
5.3.40.0070.07313.97
5.3.30.0070.07013.79
5.3.20.0070.06313.61
5.3.10.0030.07313.76
5.3.00.0130.02713.66
5.2.170.0070.04711.59
5.2.160.0070.05711.59
5.2.150.0100.05711.59
5.2.140.0030.05311.59
5.2.130.0070.05011.59
5.2.120.0070.05711.59
5.2.110.0030.05011.59
5.2.100.0000.03711.59
5.2.90.0030.04011.59
5.2.80.0130.03711.59
5.2.70.0130.05311.59
5.2.60.0000.02711.59
5.2.50.0030.06311.59
5.2.40.0100.05311.59
5.2.30.0030.02711.59
5.2.20.0070.05011.59
5.2.10.0000.02711.59
5.2.00.0100.02011.59
5.1.60.0000.04011.59
5.1.50.0000.02311.59
5.1.40.0000.02711.59
5.1.30.0030.06011.59
5.1.20.0030.06011.59
5.1.10.0030.02011.59
5.1.00.0100.02711.59
5.0.50.0030.03011.59
5.0.40.0070.01711.59
5.0.30.0000.05711.59
5.0.20.0070.01011.59
5.0.10.0030.01711.59
5.0.00.0100.03711.59
4.4.90.0000.02011.59
4.4.80.0070.01711.59
4.4.70.0000.01711.59
4.4.60.0000.02011.59
4.4.50.0000.01711.59
4.4.40.0070.02311.59
4.4.30.0000.02311.59
4.4.20.0000.02011.59
4.4.10.0000.03311.59
4.4.00.0100.02711.59
4.3.110.0030.01311.59
4.3.100.0030.01311.59
4.3.90.0000.03311.59
4.3.80.0030.04711.59
4.3.70.0000.01311.59
4.3.60.0000.01311.59
4.3.50.0000.01711.59
4.3.40.0000.02711.59
4.3.30.0000.02011.59
4.3.20.0030.03311.59
4.3.10.0000.03711.59
4.3.00.0000.01311.59

preferences:
44.03 ms | 400 KiB | 5 Q