Re: Forbid binding methods to incompatible $this

From: Date: Wed, 30 Mar 2016 20:15:32 +0000
Subject: Re: Forbid binding methods to incompatible $this
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message


On 03/30/2016 10:46 PM, Nikita Popov wrote:
On Wed, Mar 30, 2016 at 6:18 PM, Dmitry Stogov <[email protected] <mailto:[email protected]>> wrote:
    Great it's not used anymore &#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.
thank you for discovering this. Of course we can't drop or change SPL behavior. Trampoline looks like a possible but too complex solution. anyway, it would be great to remove this hack. Thanks. Dmitry.
Nikita


Thread (11 messages)

« previous php.internals (#92031) next »