Re: Forbid rebinding scope of closures created by ReflectionFunctionAbstract::getClosure()
| From: | Levi Morrison | Date: | Sat, 10 Oct 2015 22:16:31 +0000 |
| Subject: | Re: Forbid rebinding scope of closures created by ReflectionFunctionAbstract::getClosure() | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-88743@lists.php.net to get a copy of this message | ||
> Based on feedback received on an earlier version of this patch [6] [7], we
> have not added any additional restrictions on rebinding of $this.
> getClosure()s of userland methods can still be bound to arbitrary $this
> values and getClosure()s of internal methods can still be bound to
> "compatible" $this values. (If someone sees a problem with allowing the
> former, please speak up!)
>
> Note that all this applies to ReflectionFunctionAbstract::getClosure()
> only. Rebinding behavior of ordinary closures doesn't change.
A user-defined closure can be rebound freely, but not one created from
Reflection - is that correct?
My personal opinion is that we should be working to eliminate
differences between internal and user functions (including closures).
In your opinion can we make user and internal closures act more alike?
I'm assuming rebind internal methods can't be done properly because
internal objects may use different C structs than a plain zend_object
(hence the crashes). Is that correct?