summaryrefslogtreecommitdiff
path: root/Zend/tests/closure_call.phpt
diff options
context:
space:
mode:
authorBob Weinand <bobwei9@hotmail.com>2015-10-05 17:49:32 +0200
committerBob Weinand <bobwei9@hotmail.com>2015-10-05 17:49:32 +0200
commit35d0405c4790f0ce668c9e1b8b05197e55d29a05 (patch)
treefcb9d5fe2e447ba17f3ff81b19baaa989b2bf38c /Zend/tests/closure_call.phpt
parenta6be0f3fd6cdd59ac00ecd76630c6c04fee03417 (diff)
downloadphp-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_call.phpt')
-rw-r--r--Zend/tests/closure_call.phpt5
1 files changed, 1 insertions, 4 deletions
diff --git a/Zend/tests/closure_call.phpt b/Zend/tests/closure_call.phpt
index e8bed36aec..ecaa12eb40 100644
--- a/Zend/tests/closure_call.phpt
+++ b/Zend/tests/closure_call.phpt
@@ -36,7 +36,6 @@ $elePHPant->x = 7;
// Try on a StdClass
var_dump($bar->call($elePHPant));
-
$beta = function ($z) {
return $this->x * $z;
};
@@ -60,8 +59,6 @@ $foo->call(new FooBar);
int(0)
int(0)
int(3)
-
-Warning: Cannot bind closure to object of internal class stdClass in %s line %d
-NULL
+int(7)
int(21)
int(3)