Re: [RFC] Fix inconsistent behavior of $this variable
| From: | Fleshgrinder | Date: | Tue, 31 May 2016 16:55:42 +0000 |
| Subject: | Re: [RFC] Fix inconsistent behavior of $this variable | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-93656@lists.php.net to get a copy of this message | ||
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 anymore in userland:
$this = 'my value';
Hence
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
$this is correct to lexical rules but not in the context of
variables that I can use to assign something too. Hence the change of
the manual page. I did not say anything about lexical changes.
Note well that the above is already not possible in many situations:
php -r '$this = "my value";'
Fatal error: Cannot re-assign $this in Command line code on line 1
TL;DR $this does conform to syntax but not to basic PHP userland rules
for variable naming (what the manual page is about).
--
Richard "Fleshgrinder" Fussenegger
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc