mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Merge branch 'PHP-7.0'
This commit is contained in:
commit
cd6dda1679
3 changed files with 12 additions and 20 deletions
|
@ -1458,8 +1458,8 @@ ZEND_API void ZEND_FASTCALL zend_hash_apply(HashTable *ht, apply_func_t apply_fu
|
|||
HT_ASSERT(GC_REFCOUNT(ht) == 1);
|
||||
|
||||
HASH_PROTECT_RECURSION(ht);
|
||||
p = ht->arData;
|
||||
for (idx = 0; idx < ht->nNumUsed; idx++, p++) {
|
||||
for (idx = 0; idx < ht->nNumUsed; idx++) {
|
||||
p = ht->arData + idx;
|
||||
if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue;
|
||||
result = apply_func(&p->val);
|
||||
|
||||
|
@ -1484,8 +1484,8 @@ ZEND_API void ZEND_FASTCALL zend_hash_apply_with_argument(HashTable *ht, apply_f
|
|||
HT_ASSERT(GC_REFCOUNT(ht) == 1);
|
||||
|
||||
HASH_PROTECT_RECURSION(ht);
|
||||
p = ht->arData;
|
||||
for (idx = 0; idx < ht->nNumUsed; idx++, p++) {
|
||||
for (idx = 0; idx < ht->nNumUsed; idx++) {
|
||||
p = ht->arData + idx;
|
||||
if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue;
|
||||
result = apply_func(&p->val, argument);
|
||||
|
||||
|
@ -1513,8 +1513,8 @@ ZEND_API void ZEND_FASTCALL zend_hash_apply_with_arguments(HashTable *ht, apply_
|
|||
|
||||
HASH_PROTECT_RECURSION(ht);
|
||||
|
||||
p = ht->arData;
|
||||
for (idx = 0; idx < ht->nNumUsed; idx++, p++) {
|
||||
for (idx = 0; idx < ht->nNumUsed; idx++) {
|
||||
p = ht->arData + idx;
|
||||
if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue;
|
||||
va_start(args, num_args);
|
||||
hash_key.h = p->h;
|
||||
|
@ -1547,10 +1547,9 @@ ZEND_API void ZEND_FASTCALL zend_hash_reverse_apply(HashTable *ht, apply_func_t
|
|||
|
||||
HASH_PROTECT_RECURSION(ht);
|
||||
idx = ht->nNumUsed;
|
||||
p = ht->arData + idx;
|
||||
while (idx > 0) {
|
||||
idx--;
|
||||
p--;
|
||||
p = ht->arData + idx;
|
||||
if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue;
|
||||
|
||||
result = apply_func(&p->val);
|
||||
|
|
|
@ -5011,16 +5011,9 @@ PHPAPI void php_call_shutdown_functions(void) /* {{{ */
|
|||
{
|
||||
if (BG(user_shutdown_function_names)) {
|
||||
zend_try {
|
||||
zval *entry;
|
||||
for (zend_hash_internal_pointer_reset(BG(user_shutdown_function_names));
|
||||
zend_hash_has_more_elements(BG(user_shutdown_function_names)) == SUCCESS;
|
||||
zend_hash_move_forward(BG(user_shutdown_function_names))) {
|
||||
if ((entry = zend_hash_get_current_data(BG(user_shutdown_function_names))) == NULL) {
|
||||
continue;
|
||||
}
|
||||
user_shutdown_function_call(entry);
|
||||
}
|
||||
} zend_end_try();
|
||||
zend_hash_apply(BG(user_shutdown_function_names), user_shutdown_function_call);
|
||||
}
|
||||
zend_end_try();
|
||||
php_free_shutdown_functions();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,14 +13,14 @@ class Logger {
|
|||
register_shutdown_function([$this, 'flush'], true);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public function flush($final = false) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
for ($i = 0; $i < 200; $i++) {
|
||||
$a = new Logger();
|
||||
$a = new Logger();
|
||||
}
|
||||
?>
|
||||
okey
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue