diff options
author | Nikita Popov <nikic@php.net> | 2016-03-29 23:48:07 +0200 |
---|---|---|
committer | Nikita Popov <nikic@php.net> | 2016-04-08 00:38:44 +0200 |
commit | 75af8150f58fb55637ac12b33d469b27adef9d76 (patch) | |
tree | 682e004586b35e5ecb368a6f29e082779d15cd42 /Zend/tests/closure_061.phpt | |
parent | aed42496534fe54c5c0ce64fe0ca5c9d801d6161 (diff) | |
download | php-git-75af8150f58fb55637ac12b33d469b27adef9d76.tar.gz |
Forbid binding methods to incompatible $this
This prohibits binding closures returned by
ReflectionMethod::getClosure() to a $this, which is not an
instance of the method scope. This restriction was already in
place for internal methods, now it is extended to user methods.
ML discussion: http://markmail.org/message/zepnhdyr3kij6di6
Diffstat (limited to 'Zend/tests/closure_061.phpt')
-rw-r--r-- | Zend/tests/closure_061.phpt | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Zend/tests/closure_061.phpt b/Zend/tests/closure_061.phpt index 83ad16d2e1..1aa579a409 100644 --- a/Zend/tests/closure_061.phpt +++ b/Zend/tests/closure_061.phpt @@ -184,7 +184,7 @@ bindTo(new ClsChild, Cls::class): Success! bindTo(new ClsUnrelated, Cls::class): -Success! +Cannot bind method Cls::method() to object of class ClsUnrelated bindTo(new Cls, null): Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure() @@ -205,7 +205,7 @@ bindTo(new SplStack, SplDoublyLinkedList::class): Success! bindTo(new ClsUnrelated, SplDoublyLinkedList::class): -Cannot bind internal method SplDoublyLinkedList::count() to object of class ClsUnrelated +Cannot bind method SplDoublyLinkedList::count() to object of class ClsUnrelated bindTo(null, null): Cannot unbind $this of internal method |