|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2015 PHP 5.4.44
+. Fixed bug #69892 (Different arrays compare indentical due to integer key
+ truncation). (Nikita)
+
09 Jul 2015 PHP 5.4.43
- Core:
--- /dev/null
+--TEST--
+Bug #69892: Different arrays compare indentical due to integer key truncation
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platforms only"); ?>
+--FILE--
+<?php
+var_dump([0 => 0] === [0x100000000 => 0]);
+?>
+--EXPECT--
+bool(false)
}
if (ordered) {
if (p1->nKeyLength==0 && p2->nKeyLength==0) { /* numeric indices */
- result = p1->h - p2->h;
- if (result!=0) {
+ if (p1->h != p2->h) {
HASH_UNPROTECT_RECURSION(ht1);
HASH_UNPROTECT_RECURSION(ht2);
- return result;
+ return p1->h > p2->h ? 1 : -1;
}
} else { /* string indices */
result = p1->nKeyLength - p2->nKeyLength;