cvs: ZendEngine2 / zend_compile.c zend_execute_API.c

From: Date: Sat, 27 Jul 2002 15:53:14 +0000
Subject: cvs: ZendEngine2 / zend_compile.c zend_execute_API.c
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-279@lists.php.net to get a copy of this message
andi Sat Jul 27 11:53:14 2002 EDT Modified files: /ZendEngine2 zend_compile.c zend_execute_API.c Log: - Make sure classes are first looked for in the current scope. - Make sure that during inheritance the global scope is searched if the - current one doesn't work. Index: ZendEngine2/zend_compile.c diff -u ZendEngine2/zend_compile.c:1.296 ZendEngine2/zend_compile.c:1.297 --- ZendEngine2/zend_compile.c:1.296 Sun Jul 21 14:50:10 2002 +++ ZendEngine2/zend_compile.c Sat Jul 27 11:53:14 2002 @@ -2066,7 +2066,8 @@ CG(active_ce_parent_class_name).value.str.val = estrndup(parent_class_name->u.constant.value.str.val, parent_class_name->u.constant.value.str.len); CG(active_ce_parent_class_name).value.str.len = parent_class_name->u.constant.value.str.len; - if (zend_hash_find(CG(active_class_entry)?&CG(active_class_entry)->class_table:CG(class_table), parent_class_name->u.constant.value.str.val, parent_class_name->u.constant.value.str.len+1, (void **) &parent_class_p)==SUCCESS) { + if ((CG(active_class_entry) && (zend_hash_find(&CG(active_class_entry)->class_table, parent_class_name->u.constant.value.str.val, parent_class_name->u.constant.value.str.len+1, (void **) &parent_class_p) == SUCCESS)) || + zend_hash_find(CG(class_table), parent_class_name->u.constant.value.str.val, parent_class_name->u.constant.value.str.len+1, (void **) &parent_class_p) == SUCCESS) { parent_class = *parent_class_p; /* copy functions */ zend_hash_copy(&new_class_entry->function_table, &parent_class->function_table, (copy_ctor_func_t) function_add_ref, &tmp_zend_function, sizeof(zend_function)); Index: ZendEngine2/zend_execute_API.c diff -u ZendEngine2/zend_execute_API.c:1.167 ZendEngine2/zend_execute_API.c:1.168 --- ZendEngine2/zend_execute_API.c:1.167 Sat Jun 29 12:01:40 2002 +++ ZendEngine2/zend_execute_API.c Sat Jul 27 11:53:14 2002 @@ -645,6 +645,11 @@ zval *retval_ptr; int retval; + if (EG(scope)) { + if (zend_hash_find(&EG(scope)->class_table, name, name_length+1, (void **) ce) == SUCCESS) { + return SUCCESS; + } + } if (zend_hash_find(EG(class_table), name, name_length+1, (void **) ce) == SUCCESS) { return SUCCESS; }

« previous php.zend-engine.cvs (#279) next »