diff options
author | Bob Weinand <bobwei9@hotmail.com> | 2015-10-05 17:49:32 +0200 |
---|---|---|
committer | Bob Weinand <bobwei9@hotmail.com> | 2015-10-05 17:49:32 +0200 |
commit | 35d0405c4790f0ce668c9e1b8b05197e55d29a05 (patch) | |
tree | fcb9d5fe2e447ba17f3ff81b19baaa989b2bf38c /Zend/tests/closure_061.phpt | |
parent | a6be0f3fd6cdd59ac00ecd76630c6c04fee03417 (diff) | |
download | php-git-35d0405c4790f0ce668c9e1b8b05197e55d29a05.tar.gz |
Allow random $this on non-internal Closures again
As it turns out, there is actually no reason to prevent this, it even was a bigger BC break than expected...
Also fixes a memory leak (the Closure leaks) when calling internal functions via Closure by moving it out of leave helper onto caller side for TOP_CODE:
$z = new SplStack; $z->push(20);
$x = (new ReflectionMethod("SplStack", "pop"))->getClosure($z);
var_dump($x());
Diffstat (limited to 'Zend/tests/closure_061.phpt')
-rw-r--r-- | Zend/tests/closure_061.phpt | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/Zend/tests/closure_061.phpt b/Zend/tests/closure_061.phpt index 342b05ca5d..344b9438be 100644 --- a/Zend/tests/closure_061.phpt +++ b/Zend/tests/closure_061.phpt @@ -1,5 +1,5 @@ --TEST-- -Closure::call() or Closure::bind() to independent class must fail +Closure::call() or Closure::bind() to independent class --FILE-- <?php @@ -53,11 +53,4 @@ var_dump($baz->getVar()); --EXPECTF-- string(3) "baz" string(3) "bar" - -Warning: Cannot bind function foo::initClass to object of class baz in %s on line %d - -Fatal error: Uncaught Error: Function name must be a string in %s:%d -Stack trace: -#0 %s(%d): callMethodOn('foo', 'initClass', Object(baz)) -#1 {main} - thrown in %s on line %d +string(3) "foo" |