3v4l.org

run code in 300+ PHP versions simultaneously
<?php function merge(array $a, array $b) { foreach ($b as $key => $value) { if (array_key_exists($key, $a)) { if (is_int($key)) { $a[] = $value; } elseif (is_array($value) && is_array($a[$key])) { $a[$key] = static::merge($a[$key], $value); } else { $a[$key] = $value; } } else { $a[$key] = $value; } } return $a; } $a = array('person' => array( 'name' => 'franz', 'last_name' => 'de leon', )); $b = array('person' => array( 'name' => 'cheryl', )); var_dump(merge($a, $b));

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)
5.5.90.0030.06017.23
5.5.80.0070.03717.33
5.5.70.0070.05317.22
5.5.60.0070.08017.21
5.5.50.0100.04717.21
5.5.40.0130.03717.22
5.5.30.0070.07317.32
5.5.20.0030.04317.36
5.5.10.0070.08017.27
5.5.00.0170.07017.27
5.4.250.0100.07719.11
5.4.240.0070.04718.88
5.4.230.0030.05719.09
5.4.220.0070.06319.26
5.4.210.0030.05019.05
5.4.200.0100.07319.05
5.4.190.0070.06719.04
5.4.180.0070.05319.00
5.4.170.0130.07018.87
5.4.160.0100.06719.10
5.4.150.0030.04318.99
5.4.140.0100.07016.41
5.4.130.0070.07316.57
5.4.120.0030.06316.43
5.4.110.0130.06716.49
5.4.100.0230.06016.40
5.4.90.0030.05716.41
5.4.80.0100.05716.36
5.4.70.0000.07716.44
5.4.60.0030.06016.55
5.4.50.0030.07716.42
5.4.40.0100.07016.38
5.4.30.0130.07016.42
5.4.20.0030.05316.39
5.4.10.0100.03316.52
5.4.00.0070.07715.83
5.3.280.0030.04014.65
5.3.270.0030.06714.65
5.3.260.0130.05314.71
5.3.250.0100.04714.65
5.3.240.0000.06014.63
5.3.230.0130.07014.64
5.3.220.0030.08014.57
5.3.210.0030.08014.57
5.3.200.0030.07714.57
5.3.190.0030.08014.41
5.3.180.0030.07014.64
5.3.170.0100.05714.56
5.3.160.0100.07314.57
5.3.150.0070.07314.53
5.3.140.0070.07314.61
5.3.130.0130.07314.56
5.3.120.0100.07014.64
5.3.110.0130.03314.60
5.3.100.0000.05013.88
5.3.90.0030.04314.02
5.3.80.0130.07014.22
5.3.70.0130.06714.08
5.3.60.0070.05714.23
5.3.50.0100.06713.95
5.3.40.0100.07013.93
5.3.30.0000.06013.96
5.3.20.0030.04713.77
5.3.10.0070.07013.70
5.3.00.0100.06313.66
5.2.170.0070.06011.25
5.2.160.0000.07011.20
5.2.150.0100.05311.15
5.2.140.0070.05711.14
5.2.130.0030.03711.00
5.2.120.0030.06711.16
5.2.110.0000.05011.15
5.2.100.0000.07010.99
5.2.90.0030.04311.10
5.2.80.0100.04010.94
5.2.70.0000.04011.12
5.2.60.0070.05710.95
5.2.50.0070.06311.01
5.2.40.0030.04710.99
5.2.30.0100.05011.01
5.2.20.0030.06310.95
5.2.10.0030.05010.96
5.2.00.0100.03310.77
5.1.60.0070.0539.99
5.1.50.0030.0539.84
5.1.40.0030.0509.81
5.1.30.0100.04710.30
5.1.20.0070.03710.22
5.1.10.0030.05710.29
5.1.00.0070.04310.04
5.0.50.0030.0408.46
5.0.40.0030.0438.48
5.0.30.0070.0608.19
5.0.20.0070.0338.16
5.0.10.0030.0438.21
5.0.00.0030.0608.14
4.4.90.0000.0407.65
4.4.80.0030.0237.65
4.4.70.0030.0277.65
4.4.60.0000.0377.65
4.4.50.0070.0337.65
4.4.40.0000.0607.65
4.4.30.0070.0237.65
4.4.20.0030.0337.65
4.4.10.0070.0307.65
4.4.00.0070.0507.65
4.3.110.0000.0407.65
4.3.100.0000.0337.65
4.3.90.0000.0377.65
4.3.80.0000.0407.65
4.3.70.0030.0337.65
4.3.60.0030.0307.65
4.3.50.0030.0237.65
4.3.40.0070.0477.65
4.3.30.0070.0337.65
4.3.20.0030.0377.65
4.3.10.0030.0377.65
4.3.00.0000.0307.65

preferences:
142.48 ms | 1394 KiB | 7 Q