summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2016-03-02 11:54:44 +0300
committerDmitry Stogov <dmitry@zend.com>2016-03-02 11:54:44 +0300
commite66ac376cfa604c988a5ae59e65d9b93614d27ec (patch)
tree18361525a3416b3700b4b018327bccf2091f4f14
parentf2656af7df56ce9c1af77891dc46f3c7f1a8947a (diff)
parentab800642df3e66bdc00b433234a4e38c156b731c (diff)
downloadphp-git-e66ac376cfa604c988a5ae59e65d9b93614d27ec.tar.gz
Merge branch 'PHP-7.0'
* PHP-7.0: Introduce zend_symtable_exists_ind() for API consistency
-rw-r--r--Zend/zend_hash.h12
-rw-r--r--ext/standard/array.c4
2 files changed, 14 insertions, 2 deletions
diff --git a/Zend/zend_hash.h b/Zend/zend_hash.h
index 866ee8663f..f18ce5c058 100644
--- a/Zend/zend_hash.h
+++ b/Zend/zend_hash.h
@@ -380,6 +380,18 @@ static zend_always_inline int zend_symtable_exists(HashTable *ht, zend_string *k
if (ZEND_HANDLE_NUMERIC(key, idx)) {
return zend_hash_index_exists(ht, idx);
} else {
+ return zend_hash_exists(ht, key);
+ }
+}
+
+
+static zend_always_inline int zend_symtable_exists_ind(HashTable *ht, zend_string *key)
+{
+ zend_ulong idx;
+
+ if (ZEND_HANDLE_NUMERIC(key, idx)) {
+ return zend_hash_index_exists(ht, idx);
+ } else {
return zend_hash_exists_ind(ht, key);
}
}
diff --git a/ext/standard/array.c b/ext/standard/array.c
index 3e9ecdfd46..2564a924d3 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -5423,7 +5423,7 @@ PHP_FUNCTION(array_key_exists)
switch (Z_TYPE_P(key)) {
case IS_STRING:
- if (zend_symtable_exists(array, Z_STR_P(key))) {
+ if (zend_symtable_exists_ind(array, Z_STR_P(key))) {
RETURN_TRUE;
}
RETURN_FALSE;
@@ -5433,7 +5433,7 @@ PHP_FUNCTION(array_key_exists)
}
RETURN_FALSE;
case IS_NULL:
- if (zend_hash_exists(array, ZSTR_EMPTY_ALLOC())) {
+ if (zend_hash_exists_ind(array, ZSTR_EMPTY_ALLOC())) {
RETURN_TRUE;
}
RETURN_FALSE;