Skip to content

Commit e09d315

Browse files
committed
Merge branch 'PHP-5.5' into PHP-5.6
2 parents bca005c + 5fe078a commit e09d315

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
@@ -15,8 +15,10 @@ PHP NEWS
1515
7/8/8.1/10 as "Business"). (Christian Wenz)
1616
. Fixed bug #69740 (finally in generator (yield) swallows exception in
1717
iteration). (Nikita)
18-
. Fixes bug #69835 (phpinfo() does not report many Windows SKUs).
18+
. Fixed bug #69835 (phpinfo() does not report many Windows SKUs).
1919
(Christian Wenz)
20+
. Fixed bug #69892 (Different arrays compare indentical due to integer key
21+
truncation). (Nikita)
2022

2123
- GD:
2224
. Fixed bug #61221 (imagegammacorrect function loses alpha channel). (cmb)

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
@@ -1446,11 +1446,10 @@ ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t co
14461446
}
14471447
if (ordered) {
14481448
if (p1->nKeyLength==0 && p2->nKeyLength==0) { /* numeric indices */
1449-
result = p1->h - p2->h;
1450-
if (result!=0) {
1449+
if (p1->h != p2->h) {
14511450
HASH_UNPROTECT_RECURSION(ht1);
14521451
HASH_UNPROTECT_RECURSION(ht2);
1453-
return result;
1452+
return p1->h > p2->h ? 1 : -1;
14541453
}
14551454
} else { /* string indices */
14561455
result = p1->nKeyLength - p2->nKeyLength;

0 commit comments

Comments
 (0)