summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2015-08-04 14:04:24 -0700
committerStanislav Malyshev <stas@php.net>2015-08-04 14:04:24 -0700
commit51f9a00b47159ed13dfe5bd5af7e98986aa1a6fa (patch)
treedf5a155c7eb0d4c7562c7bb6d76f9e44071f9a1b
parentdda81f0505217a95db065e6bf9cc2d81eb902417 (diff)
parent7fc04937f5ba48e05d311937477ba81b0e07ffa8 (diff)
downloadphp-git-51f9a00b47159ed13dfe5bd5af7e98986aa1a6fa.tar.gz
Merge branch 'PHP-5.4' into PHP-5.4.44
* PHP-5.4: Fixed bug #69892 Adjust Git-Rules
-rw-r--r--NEWS3
-rw-r--r--README.GIT-RULES12
-rw-r--r--Zend/tests/bug69892.phpt10
-rw-r--r--Zend/zend_hash.c5
4 files changed, 21 insertions, 9 deletions
diff --git a/NEWS b/NEWS
index ab5f07dd19..544346f6a2 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,9 @@ PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 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:
diff --git a/README.GIT-RULES b/README.GIT-RULES
index 843c61ea63..c1c256dcf1 100644
--- a/README.GIT-RULES
+++ b/README.GIT-RULES
@@ -12,7 +12,7 @@ Collaboration is a Good Thing(tm), and Git lets us do this. Thus, following
some basic rules with regards to Git usage will::
a. Make everybody happier, especially those responsible for maintaining
- Git itself.
+ PHP itself.
b. Keep the changes consistently well documented and easily trackable.
@@ -48,11 +48,11 @@ Currently we have the following branches in use::
PHP-5.6 Is used to release the PHP 5.6.x series. This is a current
stable version and is open for bugfixes only.
- PHP-5.5 Is used to release the PHP 5.5.x series. This is a current
- stable version and is open for bugfixes only.
+ PHP-5.5 Is used to release the PHP 5.5.x series. This is an old
+ stable version and is open for security fixes only.
- PHP-5.4 Is used to release the PHP 5.4.x series. This is a current
- stable version and is open for bugfixes only.
+ PHP-5.4 Is used to release the PHP 5.4.x series. This is an old
+ stable version and is open for security fixes only.
PHP-5.3 This branch is closed.
@@ -67,7 +67,7 @@ Currently we have the following branches in use::
The next few rules are more of a technical nature::
- 1. All changes should first go to the lowest branch (i.e. 5.4) and then
+ 1. All changes should first go to the lowest branch (i.e. 5.6) and then
get merged up to all other branches. If a change is not needed for
later branches (i.e. fixes for features which where dropped from later
branches) an empty merge should be done.
diff --git a/Zend/tests/bug69892.phpt b/Zend/tests/bug69892.phpt
new file mode 100644
index 0000000000..d14f85fa52
--- /dev/null
+++ b/Zend/tests/bug69892.phpt
@@ -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)
diff --git a/Zend/zend_hash.c b/Zend/zend_hash.c
index bfff87a67e..9b3fb746af 100644
--- a/Zend/zend_hash.c
+++ b/Zend/zend_hash.c
@@ -1513,11 +1513,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;