]> granicus.if.org Git - php/commit
Allow random $this on non-internal Closures again
authorBob Weinand <bobwei9@hotmail.com>
Mon, 5 Oct 2015 15:49:32 +0000 (17:49 +0200)
committerBob Weinand <bobwei9@hotmail.com>
Mon, 5 Oct 2015 15:49:32 +0000 (17:49 +0200)
commit35d0405c4790f0ce668c9e1b8b05197e55d29a05
treefcb9d5fe2e447ba17f3ff81b19baaa989b2bf38c
parenta6be0f3fd6cdd59ac00ecd76630c6c04fee03417
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());
Zend/tests/bug70630.phpt
Zend/tests/closure_041.phpt
Zend/tests/closure_043.phpt
Zend/tests/closure_061.phpt
Zend/tests/closure_062.phpt
Zend/tests/closure_063.phpt
Zend/tests/closure_call.phpt
Zend/zend_closures.c
Zend/zend_execute_API.c
Zend/zend_vm_def.h
Zend/zend_vm_execute.h