summaryrefslogtreecommitdiff
path: root/Zend/zend_object_handlers.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2007-11-12 09:12:06 +0000
committerDmitry Stogov <dmitry@php.net>2007-11-12 09:12:06 +0000
commitdd3c04cea194b0a4518b0afeef2f148f8b2680cd (patch)
tree947bf125dfe2d806302bd07ceb6f7de7c3ae6701 /Zend/zend_object_handlers.c
parent9e2185990989b8c5e2ef1d0e2b4b6278461588a5 (diff)
downloadphp-git-dd3c04cea194b0a4518b0afeef2f148f8b2680cd.tar.gz
Fixed bug #42937 (__call() method not invoked when methods are called on parent from child class).
Diffstat (limited to 'Zend/zend_object_handlers.c')
-rw-r--r--Zend/zend_object_handlers.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c
index ef8ebad697..33c2bd4f8b 100644
--- a/Zend/zend_object_handlers.c
+++ b/Zend/zend_object_handlers.c
@@ -894,7 +894,25 @@ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, char *f
zend_function *fbc;
if (zend_hash_find(&ce->function_table, function_name_strval, function_name_strlen + 1, (void **) &fbc)==FAILURE) {
- if (ce->__callstatic) {
+ if (ce->__call &&
+ EG(This) &&
+ Z_OBJ_HT_P(EG(This))->get_class_entry &&
+ instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) {
+ zend_internal_function *call_user_call = emalloc(sizeof(zend_internal_function));
+
+ call_user_call->type = ZEND_INTERNAL_FUNCTION;
+ call_user_call->module = ce->module;
+ call_user_call->handler = zend_std_call_user_call;
+ call_user_call->arg_info = NULL;
+ call_user_call->num_args = 0;
+ call_user_call->scope = ce;
+ call_user_call->fn_flags = 0;
+ call_user_call->function_name = estrndup(function_name_strval, function_name_strlen);
+ call_user_call->pass_rest_by_reference = 0;
+ call_user_call->return_reference = ZEND_RETURN_VALUE;
+
+ return (union _zend_function *)call_user_call;
+ } else if (ce->__callstatic) {
zend_internal_function *callstatic_user_call = emalloc(sizeof(zend_internal_function));
callstatic_user_call->type = ZEND_INTERNAL_FUNCTION;