summaryrefslogtreecommitdiff
path: root/Zend/zend_closures.c
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/zend_closures.c')
-rw-r--r--Zend/zend_closures.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c
index a394c91c60..4430e7b250 100644
--- a/Zend/zend_closures.c
+++ b/Zend/zend_closures.c
@@ -98,6 +98,7 @@ ZEND_METHOD(Closure, call)
if (closure->func.type == ZEND_INTERNAL_FUNCTION) {
/* verify that we aren't binding internal function to a wrong object */
if ((closure->func.common.fn_flags & ZEND_ACC_STATIC) == 0 &&
+ closure->func.common.scope &&
!instanceof_function(Z_OBJCE_P(newthis), closure->func.common.scope)) {
zend_error(E_WARNING, "Cannot bind function %s::%s to object of class %s", ZSTR_VAL(closure->func.common.scope->name), ZSTR_VAL(closure->func.common.function_name), ZSTR_VAL(Z_OBJCE_P(newthis)->name));
return;