diff options
Diffstat (limited to 'Zend/zend_closures.c')
-rw-r--r-- | Zend/zend_closures.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c index 90d7eaf8c0..772eb12ecc 100644 --- a/Zend/zend_closures.c +++ b/Zend/zend_closures.c @@ -88,6 +88,12 @@ ZEND_METHOD(Closure, bind) zend_error(E_WARNING, "Cannot bind an instance to a static closure"); } + if (newthis == NULL && !(closure->func.common.fn_flags & ZEND_ACC_STATIC) + && closure->func.type == ZEND_INTERNAL_FUNCTION) { + zend_error(E_WARNING, "Cannot unbind $this of internal method"); + return; + } + if (scope_arg != NULL) { /* scope argument was given */ if (IS_ZEND_STD_OBJECT(*scope_arg)) { ce = Z_OBJCE_P(scope_arg); |