3v4l.org

run code in 300+ PHP versions simultaneously
<?php $max = 1000000; $arr = range(1,$max,3); $arr2 = range(1,$max,2); $arr = array_merge($arr,$arr2); $time = -microtime(true); $res1 = array_unique($arr); $time += microtime(true); var_dump("deduped to ".count($res1)." in ".$time); // deduped to 666667 in 32.300781965256 $time = -microtime(true); $res2 = array(); foreach($arr as $key=>$val) { $res2[$val] = true; } $res2 = array_keys($res2); $time += microtime(true); echo "<br />deduped to ".count($res2)." in ".$time;// deduped to 666667 in 0.84372591972351 

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.4.310.1900.03719.09
5.4.300.2270.04719.21
5.4.290.2170.03719.13
5.4.280.1900.04019.08
5.4.270.1800.04318.87
5.4.260.2200.05019.13
5.4.250.2030.04019.06
5.4.240.0100.07019.16
5.4.230.0030.03719.14
5.4.220.0800.03718.87
5.4.210.0570.06318.95
5.4.200.0200.04319.19
5.4.190.0270.05019.18
5.4.180.0200.03719.08
5.4.170.0170.04719.08
5.4.160.0370.04019.07
5.4.150.0230.06319.11
5.4.140.0270.03716.35
5.4.130.0200.04316.35
5.4.120.0230.06716.28
5.4.110.0270.06016.45
5.4.100.0230.06716.55
5.4.90.0170.07016.37
5.4.80.0270.03716.54
5.4.70.0270.05716.52
5.4.60.0300.03716.17
5.4.50.0130.06716.25
5.4.40.0270.06316.48
5.4.30.0200.04016.53
5.4.20.0230.03316.53
5.4.10.0200.07316.21
5.4.00.0170.03315.86
5.3.280.0200.04314.43
5.3.270.0230.07314.70
5.3.260.0230.05014.46
5.3.250.0230.05314.56
5.3.240.0230.06714.70
5.3.230.0170.06314.62
5.3.220.0200.05014.66
5.3.210.0200.07314.51
5.3.200.0200.05714.55
5.3.190.0130.04014.52
5.3.180.0130.08014.52
5.3.170.0200.03314.41
5.3.160.0200.03314.40
5.3.150.0130.04014.42
5.3.140.0230.04314.50
5.3.130.0300.06314.52
5.3.120.0200.07314.39
5.3.110.0200.07314.39
5.3.100.0200.05714.06
5.3.90.0230.07013.86
5.3.80.0200.05713.86
5.3.70.0200.05313.80
5.3.60.0270.06714.02
5.3.50.0300.04713.85
5.3.40.0200.04313.89
5.3.30.0270.05014.00
5.3.20.0130.05013.52
5.3.10.0200.04013.50
5.3.00.0200.03313.62
5.2.170.0070.03011.09
5.2.160.0100.04311.05
5.2.150.0170.03710.98
5.2.140.0170.02710.98
5.2.130.0170.03010.99
5.2.120.0130.03011.04
5.2.110.0100.03311.15
5.2.100.0130.03011.14
5.2.90.0070.04311.13
5.2.80.0170.02710.94
5.2.70.0200.02311.16
5.2.60.0170.03011.13
5.2.50.0170.04010.88
5.2.40.0130.06310.90
5.2.30.0170.02310.88
5.2.20.0130.03710.81
5.2.10.0100.03010.84
5.2.00.0200.05310.80
5.1.60.0130.02710.00
5.1.50.0100.03010.08
5.1.40.0130.0239.87
5.1.30.0100.02710.45
5.1.20.0100.03710.21
5.1.10.0100.05010.23
5.1.00.0200.02710.05
5.0.50.0030.0238.50
5.0.40.0100.0178.31
5.0.30.0030.0338.25
5.0.20.0030.0208.09
5.0.10.0070.0208.07
5.0.00.0070.0338.09
4.4.90.0070.0137.91
4.4.80.0070.0137.91
4.4.70.0070.0137.91
4.4.60.0070.0177.91
4.4.50.0100.0137.91
4.4.40.0070.0237.91
4.4.30.0100.0177.91
4.4.20.0100.0137.91
4.4.10.0030.0207.91
4.4.00.0030.0277.91
4.3.110.0070.0137.91
4.3.100.0000.0177.91
4.3.90.0000.0177.91
4.3.80.0000.0307.91
4.3.70.0070.0177.91
4.3.60.0100.0237.91
4.3.50.0030.0177.91
4.3.40.0030.0237.91
4.3.30.0030.0377.91
4.3.20.0000.0207.91
4.3.10.0000.0177.91
4.3.00.0030.0137.91

preferences:
139.32 ms | 1394 KiB | 7 Q