summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndi Gutmans <andi@php.net>2002-09-15 07:54:01 +0000
committerAndi Gutmans <andi@php.net>2002-09-15 07:54:01 +0000
commitf8ebfe7c5113c5de8cc0b097c22aa46bacaebd8c (patch)
tree3788dad705c8e052a4e6841c8d57e7d218da59c3
parent7f6c2da50a0a5e066f3dde3449d93b9beae38293 (diff)
downloadphp-git-f8ebfe7c5113c5de8cc0b097c22aa46bacaebd8c.tar.gz
- Hopefully fix problem with __autoload not working well with inherited classes.
- There might still be some weird situations I haven't thought of.
-rw-r--r--Zend/zend_compile.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 8717ec856b..066a223e46 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -1671,6 +1671,7 @@ ZEND_API int do_bind_function_or_class(zend_op *opline, HashTable *function_tabl
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 @@ ZEND_API int do_bind_function_or_class(zend_op *opline, HashTable *function_tabl
/* 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);
}