diff options
-rw-r--r-- | UPGRADING | 2 | ||||
-rw-r--r-- | Zend/tests/bug70681.phpt | 2 | ||||
-rw-r--r-- | Zend/tests/closure_061.phpt | 8 | ||||
-rw-r--r-- | Zend/zend_closures.c | 8 |
4 files changed, 8 insertions, 12 deletions
@@ -30,6 +30,8 @@ PHP 8.0 UPGRADE NOTES argument to define() may no longer be true. . Removed create_function(). Anonymous functions may be used instead. . Removed each(). foreach or ArrayIterator should be used instead. + . Removed ability to unbind $this from closures that were created from a + method, using Closure::fromCallable() or ReflectionMethod::getClosure(). - Filter: . The FILTER_FLAG_SCHEME_REQUIRED and FILTER_FLAG_HOST_REQUIRED flags for the diff --git a/Zend/tests/bug70681.phpt b/Zend/tests/bug70681.phpt index 9dd09b07b8..d0cc9523a9 100644 --- a/Zend/tests/bug70681.phpt +++ b/Zend/tests/bug70681.phpt @@ -12,5 +12,5 @@ var_dump($c("foo")); ?> --EXPECTF-- -Warning: Cannot unbind $this of internal method in %s on line %d +Warning: Cannot unbind $this of method in %s on line %d int(3) diff --git a/Zend/tests/closure_061.phpt b/Zend/tests/closure_061.phpt index f01e393570..2c574c49c0 100644 --- a/Zend/tests/closure_061.phpt +++ b/Zend/tests/closure_061.phpt @@ -175,9 +175,7 @@ Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure ------------------- bindTo(null, Cls::class): -Unbinding $this of a method is deprecated - -Success! +Cannot unbind $this of method bindTo(new Cls, Cls::class): Success! @@ -210,10 +208,10 @@ bindTo(new ClsUnrelated, SplDoublyLinkedList::class): Cannot bind method SplDoublyLinkedList::count() to object of class ClsUnrelated bindTo(null, null): -Cannot unbind $this of internal method +Cannot unbind $this of method bindTo(null, SplDoublyLinkedList::class): -Cannot unbind $this of internal method +Cannot unbind $this of method bindTo(new SplDoublyLinkedList, null): Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure() diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c index c3dbf145e9..ac95108cae 100644 --- a/Zend/zend_closures.c +++ b/Zend/zend_closures.c @@ -84,12 +84,8 @@ static zend_bool zend_valid_closure_binding( } } else if (is_fake_closure && func->common.scope && !(func->common.fn_flags & ZEND_ACC_STATIC)) { - if (func->type == ZEND_INTERNAL_FUNCTION) { - zend_error(E_WARNING, "Cannot unbind $this of internal method"); - return 0; - } else { - zend_error(E_DEPRECATED, "Unbinding $this of a method is deprecated"); - } + zend_error(E_WARNING, "Cannot unbind $this of method"); + return 0; } if (scope && scope != func->common.scope && scope->type == ZEND_INTERNAL_CLASS) { |