3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr1 = array( "0" => 5, "1" => 2, "4" => 67 ); $arr2 = array( "0" => 5, "1" => 2, "8" => 78 ); array_merge($arr2, array_fill_keys(array_diff($arr1, $arr2), 0)); print_r($arr2);

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.70.0120.00316.38
8.3.60.0180.00318.13
8.3.50.0090.00822.11
8.3.40.0200.00018.67
8.3.30.0100.00319.04
8.3.20.0070.00020.23
8.3.10.0070.00022.05
8.3.00.0080.00022.39
8.2.180.0100.00716.38
8.2.170.0140.00722.96
8.2.160.0070.00720.43
8.2.150.0070.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0000.01519.36
8.2.110.0100.01320.42
8.2.100.0090.00319.33
8.2.90.0000.00719.22
8.2.80.0030.00617.97
8.2.70.0000.00817.63
8.2.60.0070.00017.91
8.2.50.0060.00318.07
8.2.40.0080.00018.03
8.2.30.0040.00417.99
8.2.20.0050.00317.73
8.2.10.0040.00417.60
8.2.00.0000.00717.61
8.1.280.0150.00625.92
8.1.270.0080.00021.94
8.1.260.0090.00026.35
8.1.250.0070.00028.09
8.1.240.0050.00323.74
8.1.230.0040.00719.08
8.1.220.0080.00017.74
8.1.210.0000.00818.77
8.1.200.0040.00417.10
8.1.190.0040.00417.50
8.1.180.0040.00418.10
8.1.170.0040.00418.65
8.1.160.0000.00821.90
8.1.150.0050.00218.47
8.1.140.0040.00417.26
8.1.130.0000.00717.82
8.1.120.0070.00017.29
8.1.110.0000.00717.37
8.1.100.0030.00317.37
8.1.90.0030.00317.36
8.1.80.0000.00717.39
8.1.70.0040.00417.22
8.1.60.0030.00517.38
8.1.50.0040.00417.48
8.1.40.0000.00717.44
8.1.30.0000.00717.46
8.1.20.0040.00417.56
8.1.10.0000.00717.43
8.1.00.0000.00817.36
8.0.300.0000.00718.77
8.0.290.0030.00317.05
8.0.280.0070.00018.38
8.0.270.0030.00317.30
8.0.260.0030.00316.66
8.0.250.0030.00316.86
8.0.240.0040.00416.86
8.0.230.0060.00316.77
8.0.220.0050.00316.75
8.0.210.0040.00416.84
8.0.200.0000.00716.88
8.0.190.0040.00416.86
8.0.180.0070.00416.87
8.0.170.0040.00416.80
8.0.160.0040.00416.82
8.0.150.0080.00016.74
8.0.140.0040.00416.80
8.0.130.0060.00013.32
8.0.120.0040.00416.79
8.0.110.0040.00416.78
8.0.100.0000.00716.75
8.0.90.0070.00016.78
8.0.80.0070.01416.86
8.0.70.0040.00416.67
8.0.60.0040.00416.88
8.0.50.0000.00716.62
8.0.30.0050.01417.01
8.0.20.0100.00817.40
8.0.10.0000.00716.96
8.0.00.0130.00516.66
7.4.330.0030.00315.06
7.4.320.0060.00016.51
7.4.300.0070.00016.40
7.4.290.0030.00316.52
7.4.280.0070.00016.45
7.4.270.0070.00016.54
7.4.260.0040.00416.37
7.4.250.0040.00416.51
7.4.240.0070.00016.42
7.4.230.0040.00416.46
7.4.220.0070.01116.56
7.4.210.0100.00416.57
7.4.200.0000.00716.47
7.4.190.0070.00016.60
7.4.160.0150.00016.36
7.4.150.0070.01017.40
7.4.140.0130.00517.86
7.4.130.0100.00716.39
7.4.120.0120.00716.38
7.4.110.0030.01316.31
7.4.100.0060.01216.33
7.4.90.0090.00916.23
7.4.80.0140.00719.39
7.4.70.0120.00416.54
7.4.60.0090.00916.30
7.4.50.0040.00416.43
7.4.40.0030.01022.77
7.4.30.0040.01216.42
7.4.00.0070.00714.81
7.3.330.0040.00413.13
7.3.320.0060.00013.04
7.3.310.0040.00415.98
7.3.300.0030.00316.12
7.3.290.0060.00916.13
7.3.280.0100.00816.17
7.3.270.0140.00317.40
7.3.260.0150.00416.14
7.3.250.0110.00516.12
7.3.240.0070.01016.32
7.3.230.0140.00316.39
7.3.210.0100.01016.32
7.3.200.0060.01119.39
7.3.190.0130.00616.23
7.3.180.0110.00516.16
7.3.170.0040.01216.36
7.3.160.0140.00716.35
7.3.120.0000.01714.61
7.3.110.0070.01114.27
7.3.100.0070.01014.95
7.3.90.0060.00714.60
7.3.80.0060.01214.45
7.3.70.0040.01114.54
7.3.60.0040.01114.66
7.3.50.0030.00914.68
7.3.40.0030.01314.62
7.3.30.0030.00914.36
7.3.20.0060.00616.27
7.3.10.0090.00716.47
7.3.00.0080.00916.35
7.2.330.0070.01016.59
7.2.320.0030.01516.50
7.2.310.0070.01416.36
7.2.300.0030.01316.39
7.2.290.0040.01116.57
7.2.250.0000.01814.89
7.2.240.0100.01014.65
7.2.230.0060.01314.71
7.2.220.0030.01314.84
7.2.210.0030.01314.70
7.2.200.0100.01014.60
7.2.190.0040.01114.51
7.2.180.0030.01314.93
7.2.170.0100.00714.65
7.2.130.0070.00716.24
7.2.120.0040.01116.31
7.2.110.0190.00316.20
7.2.100.0080.00716.49
7.2.90.0100.00616.51
7.2.80.0120.00616.16
7.2.70.0050.01216.32
7.2.60.0100.01016.70
7.2.50.0210.00616.02
7.2.40.0210.00616.36
7.2.30.0300.01016.43
7.2.20.0270.00316.59
7.2.10.0240.01016.26
7.2.00.0160.01217.85
7.1.330.0060.00815.75
7.1.320.0040.00715.50
7.1.310.0070.00715.79
7.1.300.0060.00915.64
7.1.290.0040.01115.47
7.1.280.0060.00615.66
7.1.270.0040.01115.74
7.1.260.0090.00315.70
7.1.250.0030.00715.62
7.1.100.0030.00918.02
7.1.70.0000.00716.92
7.1.60.0100.01419.82
7.1.50.0030.01516.95
7.1.00.0000.07722.34
7.0.200.0000.00816.58
7.0.140.0070.07022.00
7.0.60.0030.04319.77
7.0.50.0100.07717.82
7.0.40.0030.07320.03
7.0.30.0370.06320.13
7.0.20.0370.07320.32
7.0.10.0230.05720.26
7.0.00.0130.07020.31
5.6.280.0000.07720.81
5.6.210.0000.05720.64
5.6.200.0130.06718.20
5.6.190.0070.05020.49
5.6.180.3730.04720.47
5.6.170.0400.06320.44
5.6.160.0070.08720.50
5.6.150.0100.05018.29
5.6.140.0130.07318.28
5.6.130.0100.08318.25
5.6.120.0070.04021.01
5.6.110.0030.04321.01
5.6.100.0130.07020.97
5.6.90.0070.08320.98
5.6.80.0070.07320.40
5.6.70.0270.07720.52
5.5.350.0070.08320.44
5.5.340.0070.06318.00
5.5.330.0070.04720.36
5.5.320.0270.04320.29
5.5.310.0330.07020.36
5.5.300.0130.03318.07
5.5.290.0070.05317.98
5.5.280.0030.04320.89
5.5.270.0000.09020.72
5.5.260.0100.07720.88
5.5.250.0030.04720.68
5.5.240.0200.04320.15
5.4.450.0630.06019.58
5.4.440.0570.05719.61
5.4.430.0070.05719.68
5.4.420.0070.05719.21
5.4.410.0130.05019.42
5.4.400.0970.00018.66
5.4.390.0770.00018.76
5.4.380.0230.05318.69
5.4.370.0170.05318.84
5.4.360.0200.04718.53
5.4.350.0230.05018.80
5.4.340.0200.05318.61
5.4.320.0040.03712.48
5.4.310.0070.05212.48
5.4.300.0070.03612.48
5.4.290.0050.03812.48
5.4.280.0050.03612.38
5.4.270.0130.05018.74
5.4.260.0070.05718.79
5.4.250.0130.05319.09
5.4.240.0100.06718.94
5.4.230.0100.06318.64
5.4.220.0170.05318.74
5.4.210.0030.05718.98
5.4.200.0100.07019.09
5.4.190.0100.05718.97
5.4.180.0100.05018.75
5.4.170.0000.06718.99
5.4.160.0230.04318.96
5.4.150.0100.07718.73
5.4.140.0200.05316.51
5.4.130.0130.06716.37
5.4.120.0130.04716.55
5.4.110.0130.06716.38
5.4.100.0030.07716.61
5.4.90.0270.05316.55
5.4.80.0100.07016.63
5.4.70.0030.05316.37
5.4.60.0200.03716.38
5.4.50.0070.05016.64
5.4.40.0100.06316.38
5.4.30.0070.05016.50
5.4.20.0130.06716.45
5.4.10.0030.08016.58
5.4.00.0130.07016.04
5.3.290.0080.03612.80
5.3.280.0100.07314.57
5.3.270.0200.04314.67
5.3.260.0130.07314.73
5.3.250.0130.05014.66
5.3.240.0130.04314.61
5.3.230.0100.06014.42
5.3.220.0200.05314.58
5.3.210.0100.05314.55
5.3.200.0170.05014.56
5.3.190.0030.06714.78
5.3.180.0030.05314.69
5.3.170.0030.05714.57
5.3.160.0070.05714.55
5.3.150.0100.07014.64
5.3.140.0170.06314.53
5.3.130.0070.07014.76
5.3.120.0100.05314.76
5.3.110.0100.05314.76
5.3.100.0070.05314.01
5.3.90.0000.05714.05
5.3.80.0170.04714.02
5.3.70.0130.04714.10
5.3.60.0100.05713.97
5.3.50.0070.04713.86
5.3.40.0070.05014.01
5.3.30.0130.05713.89
5.3.20.0170.04013.75
5.3.10.0000.05713.48
5.3.00.0070.07013.65
5.2.170.0130.04011.29
5.2.160.0030.04311.22
5.2.150.0070.04310.98
5.2.140.0070.05010.96
5.2.130.0170.03710.92
5.2.120.0130.05311.14
5.2.110.0030.05011.15
5.2.100.0100.04711.09
5.2.90.0070.04311.09
5.2.80.0030.04311.27
5.2.70.0030.04711.08
5.2.60.0130.03311.13
5.2.50.0070.04311.06
5.2.40.0100.04710.99
5.2.30.0070.04710.96
5.2.20.0100.04710.95
5.2.10.0100.04011.07
5.2.00.0100.04010.78
5.1.60.0030.04710.03
5.1.50.0070.0439.91
5.1.40.0030.0509.90
5.1.30.0070.04710.26
5.1.20.0100.04310.42
5.1.10.0030.0409.97
5.1.00.0100.0309.97
5.0.50.0070.0379.03
5.0.40.0070.0239.03
5.0.30.0100.0509.03
5.0.20.0030.0279.03
5.0.10.0030.0379.03
5.0.00.0000.0579.03
4.4.90.0100.0179.03
4.4.80.0030.0339.03
4.4.70.0070.0209.03
4.4.60.0030.0309.03
4.4.50.0070.0309.03
4.4.40.0130.0409.03
4.4.30.0000.0309.03
4.4.20.0000.0239.03
4.4.10.0000.0309.03
4.4.00.0000.0479.03
4.3.110.0070.0209.03
4.3.100.0030.0239.03
4.3.90.0000.0309.03
4.3.80.0130.0309.02
4.3.70.0030.0209.02
4.3.60.0100.0239.02
4.3.50.0030.0239.02
4.3.40.0000.0476.45
4.3.30.0000.0236.44
4.3.20.0000.0306.44
4.3.10.0030.0236.44
4.3.00.0130.0206.11

preferences:
86.09 ms | 401 KiB | 5 Q