Merge branch 'PHP-5.5' into PHP-5.6

This commit is contained in:
Nikita Popov 2015-06-20 16:40:27 +02:00
commit e09d3155a1
3 changed files with 15 additions and 4 deletions

4
NEWS
View File

@ -15,8 +15,10 @@ PHP NEWS
7/8/8.1/10 as "Business"). (Christian Wenz)
. Fixed bug #69740 (finally in generator (yield) swallows exception in
iteration). (Nikita)
. Fixes bug #69835 (phpinfo() does not report many Windows SKUs).
. Fixed bug #69835 (phpinfo() does not report many Windows SKUs).
(Christian Wenz)
. Fixed bug #69892 (Different arrays compare indentical due to integer key
truncation). (Nikita)
- GD:
. Fixed bug #61221 (imagegammacorrect function loses alpha channel). (cmb)

10
Zend/tests/bug69892.phpt Normal file
View File

@ -0,0 +1,10 @@
--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)

View File

@ -1446,11 +1446,10 @@ ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t co
}
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;