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 Rowan Collins
On 14 February 2015 20:03:44 GMT, Marc Bennewitz dev@mabe.berlin 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

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 true

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

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? I just don't

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 tyr...@gmail.com mailto:tyr...@gmail.com 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

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 rowan.coll...@gmail.com 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

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 rowan.coll...@gmail.com 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

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, somebody

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 smalys...@gmail.com 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

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 smalys...@gmail.com 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

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 is

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 tyr...@gmail.com 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

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 nikita@gmail.com wrote: On Thu, Feb 12, 2015 at 5:45 PM, Rowan Collins rowan.coll...@gmail.com 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

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 Yasuo Ohgaki
Hi Nikita, On Thu, Feb 12, 2015 at 11:24 PM, Nikita Popov nikita@gmail.com 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

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 this

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 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 least

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

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