zend_function *ctor = NULL, *dtor = NULL, *clone = NULL;
char *lowercase_name;
int fname_len;
+ zend_namespace *scope_namespace;
if (type==MODULE_PERSISTENT) {
error_type = E_CORE_WARNING;
target_function_table = CG(function_table);
}
internal_function->type = ZEND_INTERNAL_FUNCTION;
+
+ if(scope) {
+ scope_namespace = scope->ns;
+ } else {
+ scope_namespace = EG(active_namespace);
+ }
while (ptr->fname) {
internal_function->handler = ptr->handler;
internal_function->function_name = ptr->fname;
internal_function->scope = scope;
internal_function->fn_flags = ZEND_ACC_PUBLIC;
- if (!scope) {
- internal_function->ns = EG(active_namespace);
- } else {
- internal_function->ns = NULL;
- }
+ internal_function->ns = scope_namespace;
internal_function->prototype = NULL;
if (!internal_function->handler) {
zend_error(error_type, "Null function defined as active function");
orig_class_table = CG(class_table);
CG(class_table) = &ns->class_table;
}
+ class_entry->ns = ns;
register_class = zend_register_internal_class_ex(class_entry, parent_ce, NULL TSRMLS_CC);
if (restore_orig) {
EG(active_namespace) = orig_namespace;
class_container.__call = handle_fcall; \
class_container.__get = handle_propget; \
class_container.__set = handle_propset; \
+ class_container.num_interfaces = 0; \
}
#define INIT_NAMESPACE(ns_container, ns_name) INIT_CLASS_ENTRY(ns_container, ns_name, NULL)