cvs: ZendEngine2 / zend_compile.c

From: Date: Sun, 15 Sep 2002 07:54:01 +0000
Subject: cvs: ZendEngine2 / zend_compile.c
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-423@lists.php.net to get a copy of this message
andi Sun Sep 15 03:54:01 2002 EDT Modified files: /ZendEngine2 zend_compile.c Log: - Hopefully fix problem with __autoload not working well with inherited classes. - There might still be some weird situations I haven't thought of. Index: ZendEngine2/zend_compile.c diff -u ZendEngine2/zend_compile.c:1.305 ZendEngine2/zend_compile.c:1.306 --- ZendEngine2/zend_compile.c:1.305 Sun Sep 15 03:45:25 2002 +++ ZendEngine2/zend_compile.c Sun Sep 15 03:54:01 2002 @@ -1671,6 +1671,7 @@ int parent_name_length; char *class_name, *parent_name; int found_ce; + int retval; found_ce = zend_hash_find(class_table, opline->op1.u.constant.value.str.val, opline->op1.u.constant.value.str.len, (void **) &pce); @@ -1692,7 +1693,14 @@ /* Obtain parent class */ parent_name_length = class_name - opline->op2.u.constant.value.str.val - 1; parent_name = estrndup(opline->op2.u.constant.value.str.val, parent_name_length); - if (zend_hash_find(class_table, parent_name, parent_name_length+1, (void **) &parent_pce)==FAILURE) { + if (!compile_time) { + TSRMLS_FETCH(); + + retval = zend_lookup_class(parent_name, parent_name_length, &parent_pce TSRMLS_CC); + } else { + retval = zend_hash_find(class_table, parent_name, parent_name_length+1, (void **) &parent_pce); + } + if (retval == FAILURE) { if (!compile_time) { zend_error(E_ERROR, "Class %s: Cannot inherit from undefined class %s", class_name, parent_name); }

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