Re: [PHP-DEV] Forbid binding methods to incompatible $this

2016-03-30 Thread Dmitry Stogov
On 03/30/2016 10:46 PM, Nikita Popov wrote: On Wed, Mar 30, 2016 at 6:18 PM, Dmitry Stogov > wrote: Great it's not used anymore 😊 I personally agree to remove this. Nikita, can you also investigate the need for double pointer to object in typede

Re: [PHP-DEV] Forbid binding methods to incompatible $this

2016-03-30 Thread Nikita Popov
On Wed, Mar 30, 2016 at 6:18 PM, Dmitry Stogov wrote: > Great it's not used anymore [image: 😊] > > 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 > **obj

Re: [PHP-DEV] Forbid binding methods to incompatible $this

2016-03-30 Thread Dmitry Stogov
necessary only for some SPL hack, and looks like a terrible design decision. Thanks. Dmitry. From: Alexander Lisachenko Sent: Wednesday, March 30, 2016 15:07 To: Nikita Popov Cc: Dmitry Stogov; Antony Dovgal; PHP internals Subject: Re: [PHP-DEV] Forbid binding

Re: [PHP-DEV] Forbid binding methods to incompatible $this

2016-03-30 Thread Alexander Lisachenko
Hello, internals! Go! AOP was used closure rebinding to an incompatible context only for one minor specific feature, called privileged advices, where method was executing in the context of target class. But all main closure binding in the framework core work only with compatible contexts, so every

Re: [PHP-DEV] Forbid binding methods to incompatible $this

2016-03-30 Thread Nikita Popov
On Wed, Mar 30, 2016 at 11:34 AM, Dmitry Stogov wrote: > I agree, this ability is a dirty and annoying hack, but I'm sure, some > people use it. > > Tony, you don't use this in the new runkit replacement? :) > > Thanks. Dmitry. > Is this referring to https://github.com/badoo/soft-mocks? If so, s

Re: [PHP-DEV] Forbid binding methods to incompatible $this

2016-03-30 Thread Nikita Popov
On Wed, Mar 30, 2016 at 11:29 AM, Chris Riley wrote: > On 29 March 2016 at 23:21, Nikita Popov wrote: > >> Hi internals! >> >> Currently, inside instance methods the following invariant holds: >> >> assert(is_null($this) || is_object($this)) >> >> This is a problem. I'd like to guarantee the

Re: [PHP-DEV] Forbid binding methods to incompatible $this

2016-03-30 Thread Dmitry Stogov
I agree, this ability is a dirty and annoying hack, but I'm sure, some people use it. Tony, you don't use this in the new runkit replacement? :) Thanks. Dmitry. From: Nikita Popov Sent: Wednesday, March 30, 2016 01:21 To: PHP internals Subject: [PHP-DEV

Re: [PHP-DEV] Forbid binding methods to incompatible $this

2016-03-30 Thread Chris Riley
On 29 March 2016 at 23:21, Nikita Popov wrote: > Hi internals! > > Currently, inside instance methods the following invariant holds: > > assert(is_null($this) || is_object($this)) > > This is a problem. I'd like to guarantee the following invariant instead: > > assert(is_null($this) || $t