return &EG(uninitialized_zval);
}
- if ((type == BP_VAR_W || type == BP_VAR_RW) && (ht->u.v.nApplyCount > 0)) {
+ if ((type == BP_VAR_W || type == BP_VAR_RW) && intern->nApplyCount > 0) {
zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited");
return &EG(error_zval);
}
return;
}
+ if (intern->nApplyCount > 0) {
+ zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited");
+ return;
+ }
+
if (!offset) {
ht = spl_array_get_hash_table(intern);
- if (ht->u.v.nApplyCount > 0) {
- zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited");
- return;
- }
if (Z_REFCOUNTED_P(value)) {
Z_ADDREF_P(value);
}
switch (Z_TYPE_P(offset)) {
case IS_STRING:
ht = spl_array_get_hash_table(intern);
- if (ht->u.v.nApplyCount > 0) {
- zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited");
- return;
- }
zend_symtable_update_ind(ht, Z_STR_P(offset), value);
return;
case IS_DOUBLE:
index = Z_LVAL_P(offset);
num_index:
ht = spl_array_get_hash_table(intern);
- if (ht->u.v.nApplyCount > 0) {
- zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited");
- return;
- }
zend_hash_index_update(ht, index, value);
return;
case IS_NULL:
ht = spl_array_get_hash_table(intern);
- if (ht->u.v.nApplyCount > 0) {
- zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited");
- return;
- }
zend_hash_next_index_insert(ht, value);
return;
case IS_REFERENCE:
return;
}
+ if (intern->nApplyCount > 0) {
+ zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited");
+ return;
+ }
+
try_again:
switch (Z_TYPE_P(offset)) {
case IS_STRING:
ht = spl_array_get_hash_table(intern);
- if (ht->u.v.nApplyCount > 0) {
- zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited");
- return;
- }
if (ht == &EG(symbol_table)) {
if (zend_delete_global_variable(Z_STR_P(offset))) {
zend_error(E_NOTICE,"Undefined index: %s", Z_STRVAL_P(offset));
index = Z_LVAL_P(offset);
num_index:
ht = spl_array_get_hash_table(intern);
- if (ht->u.v.nApplyCount > 0) {
- zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited");
- return;
- }
if (zend_hash_index_del(ht, index) == FAILURE) {
zend_error(E_NOTICE,"Undefined offset: %pd", index);
}
ZVAL_ARR(Z_REFVAL(params[0]), aht);
if (!use_arg) {
- aht->u.v.nApplyCount++;
+ intern->nApplyCount++;
call_user_function_ex(EG(function_table), NULL, &function_name, return_value, 1, params, 1, NULL);
- aht->u.v.nApplyCount--;
+ intern->nApplyCount--;
} else if (use_arg == SPL_ARRAY_METHOD_MAY_USER_ARG) {
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "|z", &arg) == FAILURE) {
zend_throw_exception(spl_ce_BadMethodCallException, "Function expects one argument at most", 0);
if (arg) {
ZVAL_COPY_VALUE(¶ms[1], arg);
}
- aht->u.v.nApplyCount++;
+ intern->nApplyCount++;
call_user_function_ex(EG(function_table), NULL, &function_name, return_value, arg ? 2 : 1, params, 1, NULL);
- aht->u.v.nApplyCount--;
+ intern->nApplyCount--;
} else {
if (ZEND_NUM_ARGS() != 1 || zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "z", &arg) == FAILURE) {
zend_throw_exception(spl_ce_BadMethodCallException, "Function expects exactly one argument", 0);
goto exit;
}
ZVAL_COPY_VALUE(¶ms[1], arg);
- aht->u.v.nApplyCount++;
+ intern->nApplyCount++;
call_user_function_ex(EG(function_table), NULL, &function_name, return_value, 2, params, 1, NULL);
- aht->u.v.nApplyCount--;
+ intern->nApplyCount--;
}
exit:
const unsigned char *p, *s;
php_unserialize_data_t var_hash;
zval *members, *zflags;
- HashTable *aht;
zend_long flags;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &buf, &buf_len) == FAILURE) {
return;
}
- aht = spl_array_get_hash_table(intern);
- if (aht->u.v.nApplyCount > 0) {
+ if (intern->nApplyCount > 0) {
zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited");
return;
}