Re: Forbid binding methods to incompatible $this

From: Date: Wed, 30 Mar 2016 19:46:08 +0000
Subject: Re: Forbid binding methods to incompatible $this
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-92030@lists.php.net to get a copy of this message
On Wed, Mar 30, 2016 at 6:18 PM, Dmitry Stogov <dmitry@zend.com> wrote: > Great it's not used anymore [image: &#X1f60a] > > I personally agree to remove this. > > > Nikita, can you also investigate the need for double pointer to object in > > > typedef union _zend_function *(*zend_object_get_method_t)(zend_object > **object, zend_string *method, const zval *key); > > > As I remember, it's necessary only for some SPL hack, and looks like a > terrible design decision. > This is used for forwarding method calls to the the "inner" object in SPL iterators. It's basically the internal equivalent of doing: function __call($method, $args) { return $this->inner->$method(...$args); } I don't think we can drop this feature at this point (deprecate?). We can of course change the implementation to use a trampoline function to avoid the zend_object** hack, but I'm not sure that would be worthwhile. Nikita

« previous php.internals (#92030) next »