Re: [PHP-DEV] [RFC] Fix inconsistent behavior of $this variable

2016-05-31 Thread Christoph Becker
On 31.05.2016 at 18:55, Fleshgrinder wrote: > On 5/31/2016 6:39 PM, Dmitry Stogov wrote: >> >> $this is still confirm to variable syntax. It's just a special variable. >> I think, we should keep lexical rules unchanged. > > TL;DR $this does conform to syntax but not to basic PHP userland rules >

Re: [PHP-DEV] [RFC] Fix inconsistent behavior of $this variable

2016-05-31 Thread Fleshgrinder
On 5/31/2016 6:39 PM, Dmitry Stogov wrote: > Hi Richard, > > $this is still confirm to variable syntax. It's just a special variable. > I think, we should keep lexical rules unchanged. > The page is about user assignable variable names. If I understand it correct we cannot to the following anymo

Re: [PHP-DEV] [RFC] Fix inconsistent behavior of $this variable

2016-05-31 Thread Dmitry Stogov
changing "$this" into "this" is not an option. This would break 90% of PHP code :) From: Marc Bennewitz Sent: Tuesday, May 24, 2016 10:21:02 PM To: internals@lists.php.net Subject: Re: [PHP-DEV] [RFC] Fix inconsistent behavior of $thi

Re: [PHP-DEV] [RFC] Fix inconsistent behavior of $this variable

2016-05-31 Thread Dmitry Stogov
Popov Subject: Re: [PHP-DEV] [RFC] Fix inconsistent behavior of $this variable On 5/23/2016 10:24 PM, Dmitry Stogov wrote: > https://wiki.php.net/rfc/this_var > Hi Dmitry, could you extend the RFC with an additional section that mentions to update corresponding manual pages, e

Re: [PHP-DEV] [RFC] Fix inconsistent behavior of $this variable

2016-05-31 Thread Fleshgrinder
On 5/23/2016 10:24 PM, Dmitry Stogov wrote: > https://wiki.php.net/rfc/this_var > Hi Dmitry, could you extend the RFC with an additional section that mentions to update corresponding manual pages, e.g.: https://secure.php.net/language.variables.basics There is a regular expression on that page

Re: [PHP-DEV] [RFC] Fix inconsistent behavior of $this variable

2016-05-24 Thread Rowan Collins
On 24/05/2016 20:21, Marc Bennewitz wrote: As of $this is a very special variable where only the engine is (or should) be allowed to change. I would like to ask you if it wouldn't be better to NOT define $this as a special variable including a lot of code to make sure this variable doesn't get

Re: [PHP-DEV] [RFC] Fix inconsistent behavior of $this variable

2016-05-24 Thread Marc Bennewitz
On 05/24/2016 11:57 AM, Rowan Collins wrote: On 24/05/2016 06:45, Jesse Schalken wrote: I'm curious, what is it about $this that makes it special in the first place? Can't it be a normal local variable that happens to already be assigned at the start of a method? There are a few things that t

Re: [PHP-DEV] [RFC] Fix inconsistent behavior of $this variable

2016-05-24 Thread Rowan Collins
On 24/05/2016 06:45, Jesse Schalken wrote: I'm curious, what is it about $this that makes it special in the first place? Can't it be a normal local variable that happens to already be assigned at the start of a method? There are a few things that take advantage of its specialness, e.g. - bindi

RE: [PHP-DEV] [RFC] Fix inconsistent behavior of $this variable

2016-05-24 Thread Zeev Suraski
Subject: Re: [PHP-DEV] [RFC] Fix inconsistent behavior of $this variable > > On Tue, May 24, 2016 at 5:54 PM, Yasuo Ohgaki > wrote: > > > Jesse, > > > > $this must be a object you're accessing. > > > > Why? I consider it a kind of implied parameter. You

Re: [PHP-DEV] [RFC] Fix inconsistent behavior of $this variable

2016-05-24 Thread Jesse Schalken
On Tue, May 24, 2016 at 5:54 PM, Yasuo Ohgaki wrote: > Jesse, > > $this must be a object you're accessing. > Why? I consider it a kind of implied parameter. You can reassign self in Python for example. class MyClass: def foo(self, p1, p2): self = 7 print(self, p1, p2) c = M

Re: [PHP-DEV] [RFC] Fix inconsistent behavior of $this variable

2016-05-24 Thread Dmitry Stogov
On 05/24/2016 11:04 AM, Stanislav Malyshev wrote: Hi! Keeping inconsistent behavior isn't good as well. It's not good, but it's not also very bad. Nobody really does that, so whatever happens in these cases is mostly irrelevant. For me it's easier to check and fix all inconsistencies at on

Re: [PHP-DEV] [RFC] Fix inconsistent behavior of $this variable

2016-05-24 Thread Stanislav Malyshev
Hi! > Keeping inconsistent behavior isn't good as well. It's not good, but it's not also very bad. Nobody really does that, so whatever happens in these cases is mostly irrelevant. Did you test performance impact of those changes? > Actually, $this may be assigned to local variable in run-time

Re: [PHP-DEV] [RFC] Fix inconsistent behavior of $this variable

2016-05-24 Thread Yasuo Ohgaki
Jesse, On Tue, May 24, 2016 at 4:25 PM, Jesse Schalken wrote: > On Tue, May 24, 2016 at 5:18 PM, Dmitry Stogov wrote: > >> In fact $this is not a regular local variable and it must not be >> re-assigned. >> >> > You're just restating the premise for my question. Why is it not a regular > local v

Re: [PHP-DEV] [RFC] Fix inconsistent behavior of $this variable

2016-05-24 Thread Dmitry Stogov
On 05/24/2016 09:54 AM, Stanislav Malyshev wrote: Hi! Please review the RFC. It proposes to fix all known inconsistencies related to handling of special $this variable. https://wiki.php.net/rfc/this_var What is the reason behind all these changes? Does it serve some bigger purpose? I star

Re: [PHP-DEV] [RFC] Fix inconsistent behavior of $this variable

2016-05-24 Thread Jesse Schalken
On Tue, May 24, 2016 at 5:18 PM, Dmitry Stogov wrote: > In fact $this is not a regular local variable and it must not be > re-assigned. > > You're just restating the premise for my question. Why is it not a regular local variable? Why must it not be reassigned?

Re: [PHP-DEV] [RFC] Fix inconsistent behavior of $this variable

2016-05-24 Thread Dmitry Stogov
On 05/24/2016 08:45 AM, Jesse Schalken wrote: I'm curious, what is it about $this that makes it special in the first place? Can't it be a normal local variable that happens to already be assigned at the start of a method? In fact $this is not a regular local variable and it must not be re-a

Re: [PHP-DEV] [RFC] Fix inconsistent behavior of $this variable

2016-05-24 Thread Dmitry Stogov
On 05/24/2016 05:29 AM, Xinchen Hui wrote: Hey: On Tue, May 24, 2016 at 4:24 AM, Dmitry Stogov > wrote: Hi internals, Please review the RFC. It proposes to fix all known inconsistencies related to handling of special $this variable. in section st

Re: [PHP-DEV] [RFC] Fix inconsistent behavior of $this variable

2016-05-23 Thread Stanislav Malyshev
Hi! > Please review the RFC. > > It proposes to fix all known inconsistencies related to handling of special > $this variable. > > https://wiki.php.net/rfc/this_var What is the reason behind all these changes? Does it serve some bigger purpose? I'm not sure I currently see a reason to go to al

Re: [PHP-DEV] [RFC] Fix inconsistent behavior of $this variable

2016-05-23 Thread Jesse Schalken
I'm curious, what is it about $this that makes it special in the first place? Can't it be a normal local variable that happens to already be assigned at the start of a method? On Tue, May 24, 2016 at 6:24 AM, Dmitry Stogov wrote: > Hi internals, > > > Please review the RFC. > > It proposes to fi

Re: [PHP-DEV] [RFC] Fix inconsistent behavior of $this variable

2016-05-23 Thread Xinchen Hui
Hey: On Tue, May 24, 2016 at 4:24 AM, Dmitry Stogov wrote: > Hi internals, > > > Please review the RFC. > > It proposes to fix all known inconsistencies related to handling of > special $this variable. > in section static this, actually, the codes doesn't work in 7.0 neither. it will result

Re: [PHP-DEV] [RFC] Fix inconsistent behavior of $this variable

2016-05-23 Thread James Gilliland
In the section "Disable ability to re-assign $this indirectly through $$" it looks like there is a typo. It only makes sense if you mean $$a instead of $aa.

Re: [PHP-DEV] [RFC] Fix inconsistent behavior of $this variable

2016-05-23 Thread Dmitry Stogov
good point. I'll update RFC and patch to support extract() and get_defined_vars(). From: Nikita Popov Sent: Monday, May 23, 2016 11:46:35 PM To: Dmitry Stogov Cc: internals; Nikita Popov; Bob Weinand; Xinchen Hui Subject: Re: [PHP-DEV] [RFC] Fix inconsi

Re: [PHP-DEV] [RFC] Fix inconsistent behavior of $this variable

2016-05-23 Thread Nikita Popov
On Mon, May 23, 2016 at 10:24 PM, Dmitry Stogov wrote: > Hi internals, > > > Please review the RFC. > > It proposes to fix all known inconsistencies related to handling of > special $this variable. > > > https://wiki.php.net/rfc/this_var > > > Thanks. Dmitry. > How does this interact with things