mirror of
https://github.com/php/php-src.git
synced 2024-11-23 18:04:36 +08:00
Merge branch 'PHP-7.0'
* PHP-7.0: Introduce zend_symtable_exists_ind() for API consistency
This commit is contained in:
commit
e66ac376cf
@ -377,6 +377,18 @@ static zend_always_inline int zend_symtable_exists(HashTable *ht, zend_string *k
|
||||
{
|
||||
zend_ulong idx;
|
||||
|
||||
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 {
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user