diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2020-11-12 15:37:51 +0100 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2020-11-16 14:31:06 +0100 |
commit | 78773890f6b0d82b29e0b869f3f3b22174cea217 (patch) | |
tree | 8374cd88a62ab0ad067a020e01e889cbcb91d485 /Zend/tests/closure_061.phpt | |
parent | eda749260448c2cfbc628592c0943263d03d7119 (diff) | |
download | php-git-78773890f6b0d82b29e0b869f3f3b22174cea217.tar.gz |
Fix #74558: Can't rebind closure returned by Closure::fromCallable()
Failure to rebind such closures is not necessarily related to them
being created by `ReflectionFunctionAbstract::getClosure()`, so we fix
the error message.
Closes GH-6424.
Diffstat (limited to 'Zend/tests/closure_061.phpt')
-rw-r--r-- | Zend/tests/closure_061.phpt | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/Zend/tests/closure_061.phpt b/Zend/tests/closure_061.phpt index f01e393570..41863fd0c0 100644 --- a/Zend/tests/closure_061.phpt +++ b/Zend/tests/closure_061.phpt @@ -118,10 +118,10 @@ bindTo(new Cls, null): Success! bindTo(new Cls, Cls::class): -Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure() +Cannot rebind scope of closure created from function bindTo(null, Cls::class): -Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure() +Cannot rebind scope of closure created from function bindTo(null, stdClass::class): Cannot bind closure to scope of internal class stdClass @@ -139,10 +139,10 @@ bindTo(new Cls, null): Success! bindTo(new Cls, Cls::class): -Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure() +Cannot rebind scope of closure created from function bindTo(null, Cls::class): -Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure() +Cannot rebind scope of closure created from function bindTo(null, stdClass::class): Cannot bind closure to scope of internal class stdClass @@ -163,13 +163,13 @@ bindTo(new Cls, Cls::class): Cannot bind an instance to a static closure bindTo(null, null): -Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure() +Cannot rebind scope of closure created from method bindTo(null, ClsChild::class): -Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure() +Cannot rebind scope of closure created from method bindTo(null, ClsUnrelated::class): -Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure() +Cannot rebind scope of closure created from method (new Cls)->method() ------------------- @@ -189,13 +189,13 @@ bindTo(new ClsUnrelated, Cls::class): Cannot bind method Cls::method() to object of class ClsUnrelated bindTo(new Cls, null): -Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure() +Cannot rebind scope of closure created from method bindTo(new Cls, ClsUnrelated::class): -Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure() +Cannot rebind scope of closure created from method bindTo(new Cls, ClsChild::class): -Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure() +Cannot rebind scope of closure created from method (new SplDoublyLinkedList)->count() ---------------------------------- @@ -216,10 +216,10 @@ bindTo(null, SplDoublyLinkedList::class): Cannot unbind $this of internal method bindTo(new SplDoublyLinkedList, null): -Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure() +Cannot rebind scope of closure created from method bindTo(new SplDoublyLinkedList, ClsUnrelated::class): -Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure() +Cannot rebind scope of closure created from method (function() {})() ----------------- |