Re: [PHP-DEV] Remove $this from incompatible context

2015-02-16 Thread Rowan Collins
Stanislav Malyshev wrote on 16/02/2015 05:14: Hi! Agreed. Personally, I'm a great fan of symettry, so part of me would prefer to introduce a keyword for when you *can't* call a method statically, e.g. "instance function foo() { ... }". But I guess instance This would be another form of saying

Re: [PHP-DEV] Remove $this from incompatible context

2015-02-15 Thread Stanislav Malyshev
Hi! > Agreed. Personally, I'm a great fan of symettry, so part of me would > prefer to introduce a keyword for when you *can't* call a method > statically, e.g. "instance function foo() { ... }". But I guess instance This would be another form of saying "foo() method uses $this", but if that's tr

Re: [PHP-DEV] Remove $this from incompatible context

2015-02-15 Thread Rowan Collins
On 15/02/2015 19:32, Marc Bennewitz wrote: Am 15.02.2015 um 19:09 schrieb Rowan Collins: The static modifier for methods is part of the method signature and method body isn't. (That's way interfaces doesn't describe method bodies but signatures) The static modifier defines a method as static

Re: [PHP-DEV] Remove $this from incompatible context

2015-02-15 Thread Marc Bennewitz
Am 15.02.2015 um 19:09 schrieb Rowan Collins: The static modifier for methods is part of the method signature and method body isn't. (That's way interfaces doesn't describe method bodies but signatures) The static modifier defines a method as static and therefore defines the method is callabl

Re: [PHP-DEV] Remove $this from incompatible context

2015-02-15 Thread Rowan Collins
On 14 February 2015 20:03:44 GMT, Marc Bennewitz wrote: >Hi >Am 13.02.2015 um 08:48 schrieb Stanislav Malyshev: >> Hi! >> >>> there should be no bc break as the API doesn't change and the method >>> produces the exact same result as before. >> Sorry, this makes no sense to me. You claim that if yo

Re: [PHP-DEV] Remove $this from incompatible context

2015-02-14 Thread Marc Bennewitz
Hi Am 13.02.2015 um 08:48 schrieb Stanislav Malyshev: Hi! there should be no bc break as the API doesn't change and the method produces the exact same result as before. Sorry, this makes no sense to me. You claim that if you changed the method code to do different thing it should continue work

Re: [PHP-DEV] Remove $this from incompatible context

2015-02-13 Thread Rowan Collins
Kris Craig wrote on 12/02/2015 21:45: Since it's very common for environments to display E_WARNING but not E_NOTICE, some devs-- particularly those who are less experienced in PHP-- can end up wasting a lot of time trying to chase down the behavior because they're not seeing any errors. If pe

Re: [PHP-DEV] Remove $this from incompatible context

2015-02-13 Thread Rowan Collins
Nikita Popov wrote on 12/02/2015 23:33: On Fri, Feb 13, 2015 at 12:06 AM, Ferenc Kovacs > wrote: adding the E_DEPRECATED was only about the assuming $this behavior: https://wiki.php.net/rfc/incompat_ctx While the RFC may claim that, the way it was implemented w

Re: [PHP-DEV] Remove $this from incompatible context

2015-02-13 Thread Stanislav Malyshev
Hi! >> > there should be no bc break as the API doesn't change and the method >> > produces the exact same result as before. >> >> Sorry, this makes no sense to me. You claim that if you changed the >> method code to do different thing it should continue working as if you >> didn't change it? Why?

Re: [PHP-DEV] Remove $this from incompatible context

2015-02-12 Thread Stanislav Malyshev
Hi! > there should be no bc break as the API doesn't change and the method > produces the exact same result as before. Sorry, this makes no sense to me. You claim that if you changed the method code to do different thing it should continue working as if you didn't change it? Why? I just don't get

Re: [PHP-DEV] Remove $this from incompatible context

2015-02-12 Thread Stanislav Malyshev
Hi! > Such code will break, not in the first place but later on! Later on when? > You propose that every instance method not using the variable $this > internally will be magically a static method and can never ever be The difference between static method and non-static method is pretty much th

Re: [PHP-DEV] Remove $this from incompatible context

2015-02-12 Thread Yasuo Ohgaki
Hi Nikita, On Thu, Feb 12, 2015 at 11:24 PM, Nikita Popov wrote: > Any objections to implement the incompatible context removal this way? It was long time question for me allowing the code you would like to remove. If these are removed altogether(make them illegal), it would be good for users

Re: [PHP-DEV] Remove $this from incompatible context

2015-02-12 Thread Marc Bennewitz
Hi Stas, Am 12.02.2015 um 22:31 schrieb Stanislav Malyshev: Hi! class A { // This is an *instance* method, but it doesn't actually use $this. // This kind of usage is very common in PHP 4 era code, where // "static" annotations weren't used function test() { echo "

Re: [PHP-DEV] Remove $this from incompatible context

2015-02-12 Thread Nikita Popov
On Fri, Feb 13, 2015 at 12:06 AM, Ferenc Kovacs wrote: > adding the E_DEPRECATED was only about the assuming $this behavior: > https://wiki.php.net/rfc/incompat_ctx > While the RFC may claim that, the way it was implemented will throw E_DEPRECATED irregardless whether $this is used or not. As su

Re: [PHP-DEV] Remove $this from incompatible context

2015-02-12 Thread Ferenc Kovacs
On Thu, Feb 12, 2015 at 9:20 PM, Nikita Popov wrote: > On Thu, Feb 12, 2015 at 5:45 PM, Rowan Collins > wrote: > > > Nikita Popov wrote on 12/02/2015 14:24: > > > >> Hi internals, > >> > >> As part of [1] and [2] we have decided to remove support for doing > static > >> calls to instance methods

Re: [PHP-DEV] Remove $this from incompatible context

2015-02-12 Thread Kris Craig
On Thu, Feb 12, 2015 at 8:53 AM, Rowan Collins wrote: > François Laupretre wrote on 12/02/2015 14:56: > >> Sorry to get off-topic but could we raise the 'undefined variable' error >> to E_WARNING, at least ? E_NOTICE seems very low for such an error. >> > > I think the division between E_NOTICE a

Re: [PHP-DEV] Remove $this from incompatible context

2015-02-12 Thread Stanislav Malyshev
Hi! > It was always an E_STRICT error to call a non-static method statically > (as usual, not counting scoped calls) and since PHP 5.6 it was > E_DEPRECATED in the most common case. I don't see why we would suddenly > want to go back on this and make it work without any warnings. The reason why i

Re: [PHP-DEV] Remove $this from incompatible context

2015-02-12 Thread Stanislav Malyshev
Hi! > And yes, I'm pretty sure there is intent to remove this completely in the > future - this is just another leftover from PHP 4. The approach outlined > here only avoids dropping support in PHP 7 already (which the original > patch did for all practical purposes). Why btw remove it? OK, someb

Re: [PHP-DEV] Remove $this from incompatible context

2015-02-12 Thread Nikita Popov
On Thu, Feb 12, 2015 at 10:31 PM, Stanislav Malyshev wrote: > Hi! > > > class A { > > // This is an *instance* method, but it doesn't actually use $this. > > // This kind of usage is very common in PHP 4 era code, where > > // "static" annotations weren't used > > function test()

Re: [PHP-DEV] Remove $this from incompatible context

2015-02-12 Thread Nikita Popov
On Thu, Feb 12, 2015 at 10:31 PM, Stanislav Malyshev wrote: > Hi! > > > class A { > > // This is an *instance* method, but it doesn't actually use $this. > > // This kind of usage is very common in PHP 4 era code, where > > // "static" annotations weren't used > > function test()

Re: [PHP-DEV] Remove $this from incompatible context

2015-02-12 Thread Stanislav Malyshev
Hi! > class A { > // This is an *instance* method, but it doesn't actually use $this. > // This kind of usage is very common in PHP 4 era code, where > // "static" annotations weren't used > function test() { > echo "foo"; > } > } > > class B { > function test2() {

Re: [PHP-DEV] Remove $this from incompatible context

2015-02-12 Thread Nikita Popov
On Thu, Feb 12, 2015 at 5:45 PM, Rowan Collins wrote: > Nikita Popov wrote on 12/02/2015 14:24: > >> Hi internals, >> >> As part of [1] and [2] we have decided to remove support for doing static >> calls to instance methods, if this would result in an incompatible $this >> variable to be used. Wh

Re: [PHP-DEV] Remove $this from incompatible context

2015-02-12 Thread Rowan Collins
François Laupretre wrote on 12/02/2015 14:56: Sorry to get off-topic but could we raise the 'undefined variable' error to E_WARNING, at least ? E_NOTICE seems very low for such an error. I think the division between E_NOTICE and E_WARNING is a bit arbitrary sometimes, but without a good defin

Re: [PHP-DEV] Remove $this from incompatible context

2015-02-12 Thread Rowan Collins
Nikita Popov wrote on 12/02/2015 14:24: Hi internals, As part of [1] and [2] we have decided to remove support for doing static calls to instance methods, if this would result in an incompatible $this variable to be used. When applying [3] this change we found that the change as originally inten

RE: [PHP-DEV] Remove $this from incompatible context

2015-02-12 Thread François Laupretre
> De : Nikita Popov [mailto:nikita@gmail.com] > > class B { > function test2() { > A::test(); // Throws E_DEPRECATED > // Followed by E_NOTICE for undefined $this variable > } > } Sorry to get off-topic but could we raise the 'undefined variable' error to E_WARNING, at