Skip to content

Commit 9589d26

Browse files
committed
Merge branch 'PHP-5.6'
Conflicts: Zend/zend_hash.c
2 parents cc8f2b1 + e09d315 commit 9589d26

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

NEWS

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@ PHP NEWS
2020
fault). (Christoph M. Becker)
2121
. Fixed bug #69781 (phpinfo() reports Professional Editions of Windows
2222
7/8/8.1/10 as "Business"). (Christian Wenz)
23-
. Fixes bug #69835 (phpinfo() does not report many Windows SKUs).
23+
. Fixed bug #69835 (phpinfo() does not report many Windows SKUs).
2424
(Christian Wenz)
2525
. Fixed bug #69889 (Null coalesce operator doesn't work for string offsets).
2626
(Nikita)
27+
. Fixed bug #69892 (Different arrays compare indentical due to integer key
28+
truncation). (Nikita)
2729

2830
- DOM:
2931
. Fixed bug #69846 (Segmenation fault (access violation) when iterating over

Zend/tests/bug69892.phpt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
--TEST--
2+
Bug #69892: Different arrays compare indentical due to integer key truncation
3+
--SKIPIF--
4+
<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platforms only"); ?>
5+
--FILE--
6+
<?php
7+
var_dump([0 => 0] === [0x100000000 => 0]);
8+
?>
9+
--EXPECT--
10+
bool(false)

Zend/zend_hash.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2243,11 +2243,10 @@ ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t co
22432243
idx2++;
22442244
}
22452245
if (p1->key == NULL && p2->key == NULL) { /* numeric indices */
2246-
result = p1->h - p2->h;
2247-
if (result != 0) {
2246+
if (p1->h != p2->h) {
22482247
HASH_UNPROTECT_RECURSION(ht1);
22492248
HASH_UNPROTECT_RECURSION(ht2);
2250-
return result;
2249+
return p1->h > p2->h ? 1 : -1;
22512250
}
22522251
} else { /* string indices */
22532252
size_t len0 = (p1->key ? p1->key->len : 0);

0 commit comments

Comments
 (0)