[PHP-DEV] Re: Forbid rebinding scope of closures created by ReflectionFunctionAbstract::getClosure()

2015-10-10 Thread Andrea Faulds
Hi Nikita, Nikita Popov wrote: We have recently been reviewing the interaction between ReflectionFunctionAbstract::getClosure(), a mechanism which converts an ordinary function or method into a "fake" closure, and closure rebinding using Closure::bindTo() and Closure::call(). It turns out that

[PHP-DEV] Re: Forbid rebinding scope of closures created by ReflectionFunctionAbstract::getClosure()

2015-10-12 Thread Dmitry Stogov
Hi Nikita, I think the effect of the remaining patch is negligible. It disables things, that shouldn't work by design, didn't work in fact and leaded to crashes. It might work only in some cases and only because of luck. So, I think it's better to commit this before next RC. Anatol is going to st

[PHP-DEV] Re: Forbid rebinding scope of closures created by ReflectionFunctionAbstract::getClosure()

2015-10-12 Thread Nikita Popov
On Mon, Oct 12, 2015 at 8:24 PM, Dmitry Stogov wrote: > Hi Nikita, > > I think the effect of the remaining patch is negligible. > It disables things, that shouldn't work by design, didn't work in fact and > leaded to crashes. > It might work only in some cases and only because of luck. > > So, I

RE: [PHP-DEV] Re: Forbid rebinding scope of closures created by ReflectionFunctionAbstract::getClosure()

2015-10-12 Thread Anatol Belski
Hi, > -Original Message- > From: Nikita Popov [mailto:nikita@gmail.com] > Sent: Monday, October 12, 2015 8:57 PM > To: Dmitry Stogov > Cc: PHP internals ; Andrea Faulds ; Stas > Malyshev ; Bob Weinand ; > Anatol Belski > Subject: [PHP-DEV] Re: Forbid reb

Re: [PHP-DEV] Re: Forbid rebinding scope of closures created by ReflectionFunctionAbstract::getClosure()

2015-10-12 Thread Nikita Popov
; > Stas > > Malyshev ; Bob Weinand ; > > Anatol Belski > > Subject: [PHP-DEV] Re: Forbid rebinding scope of closures created by > > ReflectionFunctionAbstract::getClosure() > > > > > It would be great, if we stop any commits into PHP-7.0 except for > > critic

Re: [PHP-DEV] Re: Forbid rebinding scope of closures created by ReflectionFunctionAbstract::getClosure()

2015-10-12 Thread Dmitry Stogov
015 8:57 PM >> > To: Dmitry Stogov >> > Cc: PHP internals ; Andrea Faulds ; >> Stas >> > Malyshev ; Bob Weinand ; >> > Anatol Belski >> > Subject: [PHP-DEV] Re: Forbid rebinding scope of closures created by >> > ReflectionFunctionAbstract::ge

RE: [PHP-DEV] Re: Forbid rebinding scope of closures created by ReflectionFunctionAbstract::getClosure()

2015-10-12 Thread Anatol Belski
> -Original Message- > From: Nikita Popov [mailto:nikita@gmail.com] > Sent: Monday, October 12, 2015 10:33 PM > To: Anatol Belski > Cc: Dmitry Stogov ; PHP internals > Subject: Re: [PHP-DEV] Re: Forbid rebinding scope of closures created by > ReflectionFunctio

RE: [PHP-DEV] Re: Forbid rebinding scope of closures created by ReflectionFunctionAbstract::getClosure()

2015-10-12 Thread Anatol Belski
> -Original Message- > From: Dmitry Stogov [mailto:dmi...@zend.com] > Sent: Monday, October 12, 2015 11:55 PM > To: Nikita Popov > Cc: Anatol Belski ; PHP internals > > Subject: Re: [PHP-DEV] Re: Forbid rebinding scope of closures created by > ReflectionFunc

Re: [PHP-DEV] Re: Forbid rebinding scope of closures created by ReflectionFunctionAbstract::getClosure()

2015-10-12 Thread Xinchen Hui
> internals@lists.php.net> > > Subject: Re: [PHP-DEV] Re: Forbid rebinding scope of closures created by > > ReflectionFunctionAbstract::getClosure() > > > > On Mon, Oct 12, 2015 at 10:22 PM, Anatol Belski > > wrote: > > > > > Hi, > > > >

RE: [PHP-DEV] Re: Forbid rebinding scope of closures created by ReflectionFunctionAbstract::getClosure()

2015-10-13 Thread Anatol Belski
2, 2015 10:33 PM > > > To: Anatol Belski > > > Cc: Dmitry Stogov ; PHP internals < > > internals@lists.php.net> > > > Subject: Re: [PHP-DEV] Re: Forbid rebinding scope of closures > > > created by > > > ReflectionFunctionAbstract::getClosure()

Re: [PHP-DEV] Re: Forbid rebinding scope of closures created by ReflectionFunctionAbstract::getClosure()

2015-10-19 Thread Alexander Lisachenko
: > > > > > > > > > > > > -Original Message- > > > > From: Nikita Popov [mailto:nikita....@gmail.com] > > > > Sent: Monday, October 12, 2015 10:33 PM > > > > To: Anatol Belski > > > > Cc: Dmitry Stogov ; P

RE: [PHP-DEV] Re: Forbid rebinding scope of closures created by ReflectionFunctionAbstract::getClosure()

2015-10-19 Thread Anatol Belski
Hi Alexander, > -Original Message- > From: Alexander Lisachenko [mailto:lisachenko...@gmail.com] > Sent: Monday, October 19, 2015 10:19 AM > To: Anatol Belski > Cc: Xinchen Hui ; Nikita Popov ; > Dmitry Stogov ; PHP internals > Subject: Re: [PHP-DEV] Re: Forb

Re: [PHP-DEV] Re: Forbid rebinding scope of closures created by ReflectionFunctionAbstract::getClosure()

2015-10-19 Thread Nikita Popov
On Mon, Oct 19, 2015 at 10:18 AM, Alexander Lisachenko < lisachenko...@gmail.com> wrote: > Hello, internals! > > Just noticed this thread and want to clarify some things with getClosure() > method. If i understood correctly, ReflectionFunctionAbstract::getClosure() > should return non-rebindable c

Re: [PHP-DEV] Re: Forbid rebinding scope of closures created by ReflectionFunctionAbstract::getClosure()

2015-10-19 Thread Alexander Lisachenko
2015-10-19 12:19 GMT+03:00 Nikita Popov : > This change is primarily targeting userland methods, so your use-case is > exactly the one this is supposed to prevent. Note that you can still use > ->bindTo($object). The only thing you cannot do is ->bindTo($object, > get_class($object)). It's very

Re: [PHP-DEV] Re: Forbid rebinding scope of closures created by ReflectionFunctionAbstract::getClosure()

2015-10-22 Thread Julien Pauli
On Mon, Oct 19, 2015 at 12:34 PM, Alexander Lisachenko wrote: > 2015-10-19 12:19 GMT+03:00 Nikita Popov : > >> This change is primarily targeting userland methods, so your use-case is >> exactly the one this is supposed to prevent. Note that you can still use >> ->bindTo($object). The only thing y

Re: [PHP-DEV] Re: Forbid rebinding scope of closures created by ReflectionFunctionAbstract::getClosure()

2015-10-22 Thread Kalle Sommer Nielsen
2015-10-22 17:48 GMT+02:00 Julien Pauli : > This is very tricky use case IMO. > > We should absolutely focus on stability, and if we can't find a way to > make things safe, we forbid them > for the stability sake. If there are no way to have stable things, > well, that's pitty but it's like that. >

Re: [PHP-DEV] Re: Forbid rebinding scope of closures created by ReflectionFunctionAbstract::getClosure()

2015-10-23 Thread Alexander Lisachenko
2015-10-22 18:48 GMT+03:00 Julien Pauli : > This is very tricky use case IMO. > > We should absolutely focus on stability, and if we can't find a way to > make things safe, we forbid them > for the stability sake. If there are no way to have stable things, > well, that's pitty but it's like that.