Skip to content

Commit b0c920f

Browse files
committed
Simplify __call fetching for static methods
If we have a __call on a parent, we should always also have a __call on the child, so there's no need to perform this walk.
1 parent 12fec7a commit b0c920f

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

Zend/zend_object_handlers.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1379,12 +1379,8 @@ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, zend_st
13791379
/* Call the top-level defined __call().
13801380
* see: tests/classes/__call_004.phpt */
13811381

1382-
zend_class_entry *call_ce = object->ce;
1383-
1384-
while (!call_ce->__call) {
1385-
call_ce = call_ce->parent;
1386-
}
1387-
return zend_get_user_call_function(call_ce, function_name);
1382+
ZEND_ASSERT(object->ce->__call);
1383+
return zend_get_user_call_function(object->ce, function_name);
13881384
} else if (ce->__callstatic) {
13891385
return zend_get_user_callstatic_function(ce, function_name);
13901386
} else {

0 commit comments

Comments
 (0)