3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class wtf { function array_merge_recursive_distinct() { $arrays = func_get_args(); $base = array_shift($arrays); foreach ($arrays as $array) { reset($base); //important while (list($key, $value) = @each($array)) { if (is_array($value) && @is_array($base[$key])) { $base[$key] = self::array_merge_recursive_distinct($base[$key], $value); } else { $base[$key] = $value; } } } return $base; } } $a = array( "exists" => 1, "doesnotexist" => 1, "arraytest" => array( "exists" => 1, "doesnotexist" => 1 ) ); $b = array( "exists" => 2, "arraytest" => array( "exists" => 2, ) ); $c = wtf::array_merge_recursive_distinct($a, $b); print_r($c);

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.0070.01316.75
8.3.60.0090.00916.88
8.3.50.0130.00721.99
8.3.40.0150.00618.79
8.3.30.0030.01018.80
8.3.20.0040.00420.34
8.3.10.0030.00523.59
8.3.00.0040.00417.99
8.2.190.0070.00716.88
8.2.180.0140.00418.54
8.2.170.0140.00722.96
8.2.160.0070.00720.47
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0000.00917.63
8.2.110.0100.00020.96
8.2.100.0040.00817.72
8.2.90.0000.00819.28
8.2.80.0050.00317.97
8.2.70.0060.00317.63
8.2.60.0050.00317.65
8.2.50.0040.00418.07
8.2.40.0060.00321.05
8.2.30.0080.00020.57
8.2.20.0040.00417.63
8.2.10.0080.00017.96
8.2.00.0040.00418.15
8.1.280.0110.00425.92
8.1.270.0080.00023.73
8.1.260.0000.00726.35
8.1.250.0040.00428.09
8.1.240.0070.01021.25
8.1.230.0040.00720.93
8.1.220.0040.00417.74
8.1.210.0080.00018.77
8.1.200.0100.00017.13
8.1.190.0000.00817.23
8.1.180.0090.00318.10
8.1.170.0040.00718.53
8.1.160.0040.00421.98
8.1.150.0000.00718.85
8.1.140.0030.00619.54
8.1.130.0030.00317.66
8.1.120.0000.00717.44
8.1.110.0000.00717.32
8.1.100.0040.00417.39
8.1.90.0000.00817.43
8.1.80.0000.00817.42
8.1.70.0070.00017.43
8.1.60.0040.00417.57
8.1.50.0030.00617.46
8.1.40.0000.00817.56
8.1.30.0050.00317.58
8.1.20.0000.00717.66
8.1.10.0000.00717.59
8.1.00.0040.00417.57
8.0.300.0000.00918.77
8.0.290.0000.00816.75
8.0.280.0030.00318.38
8.0.270.0030.00417.08
8.0.260.0030.00317.22
8.0.250.0040.00416.96
8.0.240.0070.00016.92
8.0.230.0000.00716.87
8.0.220.0000.00716.93
8.0.210.0030.00616.78
8.0.200.0060.00016.94
8.0.190.0050.00316.94
8.0.180.0070.00016.78
8.0.170.0000.00816.94
8.0.160.0030.00316.82
8.0.150.0030.00516.88
8.0.140.0040.00416.91
8.0.130.0060.00013.34
8.0.120.0030.00616.97
8.0.110.0070.00016.90
8.0.100.0080.00017.04
8.0.90.0070.00016.93
8.0.80.0080.00816.89
8.0.70.0040.00316.91
8.0.60.0020.00516.91
8.0.50.0000.00716.74
8.0.30.0110.00817.13
8.0.20.0090.00917.40
8.0.10.0000.00817.09
8.0.00.0100.00716.84
7.4.330.0050.00015.20
7.4.320.0070.00016.61
7.4.300.0040.00416.52
7.4.290.0000.00716.45
7.4.280.0030.00516.57
7.4.270.0030.00316.58
7.4.260.0030.00316.60
7.4.250.0000.00716.58
7.4.240.0000.00716.45
7.4.230.0030.00316.52
7.4.220.0070.01016.56
7.4.210.0040.01116.51
7.4.200.0070.00016.64
7.4.160.0160.00016.75
7.4.150.0160.00617.40
7.4.140.0160.00817.86
7.4.130.0110.00916.64
7.4.120.0110.00716.45
7.4.110.0110.00716.77
7.4.100.0030.01316.51
7.4.90.0100.00716.58
7.4.80.0140.00619.39
7.4.70.0030.01316.77
7.4.60.0100.00616.46
7.4.50.0020.00216.36
7.4.40.0090.00916.61
7.4.30.0090.01516.39
7.4.00.0060.01214.95
7.3.330.0030.00313.30
7.3.320.0030.00313.30
7.3.310.0000.00716.30
7.3.300.0000.00716.42
7.3.290.0080.00816.43
7.3.280.0090.00816.46
7.3.270.0070.01117.40
7.3.260.0170.00016.41
7.3.250.0100.00916.40
7.3.240.0080.01216.51
7.3.230.0130.00316.47
7.3.210.0030.01316.61
7.3.200.0030.01316.46
7.3.190.0040.01316.69
7.3.180.0060.01016.62
7.3.170.0030.01216.64
7.3.160.0080.00916.59
7.3.120.0120.00615.05
7.3.110.0060.01114.93
7.3.100.0100.00514.69
7.3.90.0030.01114.80
7.3.80.0080.00814.95
7.3.70.0050.01315.01
7.3.60.0090.00414.82
7.3.50.0060.00914.54
7.3.40.0050.00914.71
7.3.30.0050.00914.89
7.3.20.0130.00516.59
7.3.10.0040.00816.62
7.3.00.0050.01116.65
7.2.330.0090.00916.86
7.2.320.0070.00916.72
7.2.310.0040.01316.54
7.2.300.0120.00616.89
7.2.290.0090.00916.62
7.2.250.0050.01115.21
7.2.240.0110.00815.13
7.2.230.0050.01114.97
7.2.220.0080.00815.10
7.2.210.0090.00315.14
7.2.200.0030.01015.02
7.2.190.0100.00314.97
7.2.180.0030.01014.99
7.2.170.0030.01015.08
7.2.130.0040.00916.96
7.2.120.0090.00916.92
7.2.110.0080.01017.05
7.2.100.0100.00817.00
7.2.90.0040.01117.08
7.2.80.0060.00816.99
7.2.70.0070.00716.91
7.2.60.0070.00917.02
7.2.50.0080.00917.09
7.2.40.0070.00716.97
7.2.30.0080.00917.05
7.2.20.0090.00916.89
7.2.10.0050.01117.02
7.2.00.0040.00917.67
7.1.330.0090.00415.88
7.1.320.0090.00915.88
7.1.310.0060.00815.89
7.1.300.0060.00415.58
7.1.290.0030.00715.72
7.1.280.0060.00915.51
7.1.270.0090.00515.69
7.1.260.0050.00715.83
7.1.250.0100.00615.84
7.1.200.0040.01115.73
7.1.100.0030.00618.07
7.1.70.0040.00717.34
7.1.60.0000.02419.11
7.1.50.0060.01516.92
7.1.00.0070.07322.36
7.0.200.0820.00614.81
7.0.60.0070.07319.88
7.0.50.0030.04317.86
7.0.40.0070.08720.09
7.0.30.0230.05020.10
7.0.20.0270.08020.16
7.0.10.0270.08020.23
7.0.00.0100.09020.20
5.6.280.0000.04020.92
5.6.210.0070.06320.77
5.6.200.0030.04718.16
5.6.190.0070.08020.61
5.6.180.4030.04320.49
5.6.170.0130.05320.55
5.6.160.0030.08720.41
5.6.150.0100.04318.25
5.6.140.0100.07018.14
5.6.130.0030.05318.28
5.6.120.0070.07721.02
5.6.110.0070.05321.02
5.6.100.0030.04020.99
5.6.90.0070.06321.04
5.6.80.0070.06020.41
5.6.70.0000.03720.52
5.5.350.0200.06320.43
5.5.340.0070.04317.95
5.5.330.0100.08320.40
5.5.320.0430.07020.35
5.5.310.0270.07720.18
5.5.300.0130.06717.97
5.5.290.0100.07318.04
5.5.280.0000.04320.78
5.5.270.0030.06320.88
5.5.260.0170.08020.77
5.5.250.0100.06720.65
5.5.240.0130.07720.18
5.4.450.0130.06719.56
5.4.440.0130.07319.33
5.4.430.0130.05719.45
5.4.420.0230.04319.47
5.4.410.0170.05719.44
5.4.400.0200.06018.85
5.4.390.0270.06319.24
5.4.380.0370.04719.05
5.4.370.0270.05719.06
5.4.360.0230.06719.16
5.4.350.0100.07018.85
5.4.340.0100.06019.23
5.4.320.0270.04718.85
5.4.310.0270.05319.15
5.4.300.0130.06019.15
5.4.290.0170.05318.84
5.4.280.0270.05018.95
5.4.270.0200.05019.32
5.4.260.0130.06318.79
5.4.250.0200.06019.27
5.4.240.0170.05719.20
5.4.230.0300.05319.27
5.4.220.0700.05719.05
5.4.210.0470.05019.14
5.4.200.0700.04019.27
5.4.190.0530.05719.23
5.4.180.0800.05318.96
5.4.170.0570.05319.23
5.4.160.0430.04318.81
5.4.150.0100.06019.23
5.4.140.0400.05316.36
5.4.130.0570.04716.55
5.4.120.0330.04016.43
5.4.110.0100.05016.62
5.4.100.0230.05316.28
5.4.90.0630.05016.62
5.4.80.0530.05316.41
5.4.70.0070.05716.43
5.4.60.0300.05716.58
5.4.50.0670.07016.25
5.4.40.0730.04316.55
5.4.30.0600.04716.48
5.4.20.0800.05016.50
5.4.10.0700.05716.38
5.4.00.0930.04715.84

preferences:
102.74 ms | 402 KiB | 5 Q