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.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c
index e8688a6fd1..a8c4a89862 100644
--- a/Zend/zend_closures.c
+++ b/Zend/zend_closures.c
@@ -90,6 +90,9 @@ static zend_bool zend_valid_closure_binding(
} else {
zend_error(E_DEPRECATED, "Unbinding $this of a method is deprecated");
}
+ } else if (!is_fake_closure && !Z_ISUNDEF(closure->this_ptr)) {
+ // TODO: Only deprecate if it had $this *originally*?
+ zend_error(E_DEPRECATED, "Unbinding $this of closure is deprecated");
}
if (scope && scope != func->common.scope && scope->type == ZEND_INTERNAL_CLASS) {