Re: [RFC] Fix inconsistent behavior of $this variable
| From: | Fleshgrinder | Date: | Tue, 31 May 2016 16:19:57 +0000 |
| Subject: | Re: [RFC] Fix inconsistent behavior of $this variable | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-93653@lists.php.net to get a copy of this message | ||
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 that looks like the following
and is often referred to by people explaining variable names in PHP:
[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*
I would propose to update this to the following more complete PCRE:
/^\$?(?!this)[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/D
@nikic this is also important for your RFC regarding empty variable
names because the PCRE would need to be updated once more too:
/^\$?(?!this)[a-zA-Z_\x7f-\xff]?[a-zA-Z0-9_\x7f-\xff]*$/D
Of course the sentence preceding the regular expression would also
require an update.
There might be more pages that I am not aware of but we could ask
someone from the documentation team to help us here. The above one is
definitely the most important one and it should imho be included in the RFC.
--
Richard "Fleshgrinder" Fussenegger
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc