Commit Graph

6 Commits

Author SHA1 Message Date
Nikita Popov
4b821f0fc6 Normalize rebinding failures
Move all rebinding checks into one function to make sure they stay
in sync. Normalize return value to be NULL for all rebinding
failures, instead of returning an improperly bound closure in some
cases.
2015-10-10 13:56:36 +02:00
Dmitry Stogov
524d00e005 Revert "Allow random $this on non-internal Closures again"
This reverts commit 35d0405c47.
2015-10-06 23:48:10 +03:00
Bob Weinand
35d0405c47 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());
2015-10-05 17:49:32 +02:00
Stanislav Malyshev
ef8bb69a14 Ban rebinding closures to different internal classes 2015-05-12 10:54:59 +02:00
Andrea Faulds
59010bff01 Don't allow unbound scoped closures; make ->call used passed object as scope 2014-08-17 23:47:47 +01:00
Andrea Faulds
f65bdda469 Rename ::apply to ::call for the sake of JS consistency 2014-07-30 01:26:53 +01:00