{
zend_class_entry *disabled_class;
zend_string *key;
+ zend_function *fn;
key = zend_string_alloc(class_name_length, 0);
zend_str_tolower_copy(ZSTR_VAL(key), class_name, class_name_length);
if (!disabled_class) {
return FAILURE;
}
+
INIT_CLASS_ENTRY_INIT_METHODS((*disabled_class), disabled_class_new);
disabled_class->create_object = display_disabled_class;
+
+ ZEND_HASH_FOREACH_PTR(&disabled_class->function_table, fn) {
+ if ((fn->common.fn_flags & (ZEND_ACC_HAS_RETURN_TYPE|ZEND_ACC_HAS_TYPE_HINTS)) &&
+ fn->common.scope == disabled_class) {
+ zend_free_internal_arg_info(&fn->internal_function);
+ }
+ } ZEND_HASH_FOREACH_END();
zend_hash_clean(&disabled_class->function_table);
return SUCCESS;
}
void zend_free_internal_arg_info(zend_internal_function *function) {
if ((function->fn_flags & (ZEND_ACC_HAS_RETURN_TYPE|ZEND_ACC_HAS_TYPE_HINTS)) &&
- !function->scope && function->arg_info) {
+ function->arg_info) {
uint32_t i;
uint32_t num_args = function->num_args + 1;
ZEND_ASSERT(function->common.function_name);
zend_string_release_ex(function->common.function_name, 1);
- zend_free_internal_arg_info(&function->internal_function);
+ /* For methods this will be called explicitly. */
+ if (!function->common.scope) {
+ zend_free_internal_arg_info(&function->internal_function);
+ }
if (!(function->common.fn_flags & ZEND_ACC_ARENA_ALLOCATED)) {
pefree(function, 1);
ZEND_HASH_FOREACH_PTR(&ce->function_table, fn) {
if ((fn->common.fn_flags & (ZEND_ACC_HAS_RETURN_TYPE|ZEND_ACC_HAS_TYPE_HINTS)) &&
fn->common.scope == ce) {
- /* reset function scope to allow arg_info removing */
- fn->common.scope = NULL;
+ zend_free_internal_arg_info(&fn->internal_function);
}
} ZEND_HASH_FOREACH_END();