3v4l.org

run code in 300+ PHP versions simultaneously
<?php function countHashes ($array) { $count = array(); foreach ($array as $val) { $hash = spl_object_hash($val); if (! isset($count[$hash])) { $count[$hash] = 0; } $count[$hash]++; } return $count; }; function checkWhetherSame($array1, $array2) { $count1 = countHashes($array1); $count2 = countHashes($array2); if (count($count1) === count($count2)) { foreach ($count1 as $key => $value) { if ($count2[$key] !== $value) { return false; } } return true; }; $a = new StdClass(); $b = new StdClass(); $array1 = array($a, $a, $b); $array2 = array($a, $b, $b); var_dump(checkWhetherSame($array1, $array2));

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.240.0300.06319.06
5.4.230.0300.04318.85
5.4.220.0270.06719.30
5.4.210.0300.04019.07
5.4.200.0400.04019.23
5.4.190.0200.07719.02
5.4.180.0270.04719.15
5.4.170.0330.04318.98
5.4.160.0270.07019.05
5.4.150.0170.04019.29
5.4.140.0270.06716.55
5.4.130.0200.07316.40
5.4.120.0170.06716.38
5.4.110.0170.07016.61
5.4.100.0300.06316.50
5.4.90.0230.06316.50
5.4.80.0270.06316.58
5.4.70.0230.04716.22
5.4.60.0200.07316.53
5.4.50.0270.06016.43
5.4.40.0130.07316.52
5.4.30.0300.06716.55
5.4.20.0170.03316.38
5.4.10.0270.06316.51
5.4.00.0230.04315.80
5.3.280.0170.07714.52
5.3.270.0270.04714.62
5.3.260.0200.06014.53
5.3.250.0170.07314.62
5.3.240.0270.06314.63
5.3.230.0270.06014.53
5.3.220.0230.06014.47
5.3.210.0130.08014.65
5.3.200.0230.06714.66
5.3.190.0100.05314.50
5.3.180.0170.03714.47
5.3.170.0200.05014.53
5.3.160.0230.06714.47
5.3.150.0230.07014.57
5.3.140.0270.07014.57
5.3.130.0170.05714.46
5.3.120.0200.04014.67
5.3.110.0200.07714.71
5.3.100.0300.06014.13
5.3.90.0270.06714.02
5.3.80.0200.07714.10
5.3.70.0300.05714.15
5.3.60.0230.07013.92
5.3.50.0230.04313.85
5.3.40.0230.07014.04
5.3.30.0100.06714.14
5.3.20.0170.06713.60
5.3.10.0230.03713.77
5.3.00.0200.03713.73

preferences:
137.46 ms | 1386 KiB | 7 Q