diff options
author | Kalle Sommer Nielsen <kalle@php.net> | 2018-07-23 17:38:52 +0200 |
---|---|---|
committer | Kalle Sommer Nielsen <kalle@php.net> | 2018-07-23 17:38:52 +0200 |
commit | 0b7686584e4bda026e895692b532b302ca734270 (patch) | |
tree | 458d9cdc48fb230f0099513b0337db525c1de3e4 /ext/standard/array.c | |
parent | ba138a3746b3077ebe5b7356b5b49f21cfc30438 (diff) | |
parent | 7ef8e3f87f1ace8431cdd8252a8b355529200666 (diff) | |
download | php-git-0b7686584e4bda026e895692b532b302ca734270.tar.gz |
Merge branch 'master' of git.php.net:/php-src
Diffstat (limited to 'ext/standard/array.c')
-rw-r--r-- | ext/standard/array.c | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/ext/standard/array.c b/ext/standard/array.c index ec402eac36..25e8520cc8 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -3100,14 +3100,10 @@ static void php_splice(HashTable *in_hash, zend_long offset, zend_long length, H p = in_hash->arData + idx; if (Z_TYPE(p->val) == IS_UNDEF) continue; pos2++; - if (p->key == NULL) { - zend_hash_del_bucket(in_hash, p); + if (p->key && in_hash == &EG(symbol_table)) { + zend_delete_global_variable(p->key); } else { - if (in_hash == &EG(symbol_table)) { - zend_delete_global_variable(p->key); - } else { - zend_hash_del_bucket(in_hash, p); - } + zend_hash_del_bucket(in_hash, p); } } } @@ -3231,12 +3227,8 @@ PHP_FUNCTION(array_pop) } /* Delete the last value */ - if (p->key) { - if (Z_ARRVAL_P(stack) == &EG(symbol_table)) { - zend_delete_global_variable(p->key); - } else { - zend_hash_del_bucket(Z_ARRVAL_P(stack), p); - } + if (p->key && Z_ARRVAL_P(stack) == &EG(symbol_table)) { + zend_delete_global_variable(p->key); } else { zend_hash_del_bucket(Z_ARRVAL_P(stack), p); } @@ -3281,12 +3273,8 @@ PHP_FUNCTION(array_shift) ZVAL_COPY_DEREF(return_value, val); /* Delete the first value */ - if (p->key) { - if (Z_ARRVAL_P(stack) == &EG(symbol_table)) { - zend_delete_global_variable(p->key); - } else { - zend_hash_del_bucket(Z_ARRVAL_P(stack), p); - } + if (p->key && Z_ARRVAL_P(stack) == &EG(symbol_table)) { + zend_delete_global_variable(p->key); } else { zend_hash_del_bucket(Z_ARRVAL_P(stack), p); } |