Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93654 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 72709 invoked from network); 31 May 2016 16:39:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 May 2016 16:39:59 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 207.46.100.145 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 207.46.100.145 mail-by2on0145.outbound.protection.outlook.com Received: from [207.46.100.145] ([207.46.100.145:33820] helo=na01-by2-obe.outbound.protection.outlook.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BD/0A-26200-C5EBD475 for ; Tue, 31 May 2016 12:39:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=RWSoftware.onmicrosoft.com; s=selector1-zend-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=nzwOhO6juaJJgXNloeQmSU422FMuSAwrn45Q6eT28WY=; b=upBqssSStrssHoOO8b4K+dJa8lou5C33R9w5CtDRiUkhL6TazGXCZiSRLg4QrJHUReRoo+TsPIn1Aqcku1CUFw8+G08++fh5DDiOlbwapV2tiTjOeNztPtmHPBjwpJvVtSlHshgr6EQPqe+q1DMJT1IMH+frMSWOGRQmyn5Bkgk= Received: from BY2PR0201MB1784.namprd02.prod.outlook.com (10.163.72.26) by BY2PR0201MB1783.namprd02.prod.outlook.com (10.163.72.25) with Microsoft SMTP Server (TLS) id 15.1.501.7; Tue, 31 May 2016 16:39:52 +0000 Received: from BY2PR0201MB1784.namprd02.prod.outlook.com ([10.163.72.26]) by BY2PR0201MB1784.namprd02.prod.outlook.com ([10.163.72.26]) with mapi id 15.01.0501.017; Tue, 31 May 2016 16:39:52 +0000 To: internals , Nikita Popov Thread-Topic: [PHP-DEV] [RFC] Fix inconsistent behavior of $this variable Thread-Index: AQHRtTC0CwOThBGXuUmMwxcXw+u9D5/TRimAgAAEai0= Date: Tue, 31 May 2016 16:39:51 +0000 Message-ID: References: ,<1932f04f-c015-3956-a89c-8e96d2902e67@fleshgrinder.com> In-Reply-To: <1932f04f-c015-3956-a89c-8e96d2902e67@fleshgrinder.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: lists.php.net; dkim=none (message not signed) header.d=none;lists.php.net; dmarc=none action=none header.from=zend.com; x-originating-ip: [132.245.81.165] x-ms-office365-filtering-correlation-id: 02a7d5da-2723-40eb-8dc4-08d38972308a x-microsoft-exchange-diagnostics: 1;BY2PR0201MB1783;5:yIb6BW/iz2uK4o0C+wp9fR8d8yuUh/HBTRF2RP6nPncjyNZzKa5TCmqEbZXslBTRqysPTelwsTcvSsG3No5yL6DC2vr3tGZnbp8l+UNe9wBKjPBHfpFUEv1L5vLqe6RL6PY/Bvm+S/GeWPnL/X5bVw==;24:YTMKRnfwc8ShXR3Kn2isa4P1Eq5U35+hUbALU0qNtoLJ+2h6tGpq/mZHMpqjlmyjpLYEWpcheh8LmG1I3bMTtIdOR+T4RDST9llBMQGHkpY=;7:FupFIt+73vgp6N4U73BUvCeVxArEyh1XRMQ0HUrk1SrilNlXwUX1EYdpy15et+olp7vep75Ndy7mFFC+WsNKOGrm4qf/+5WxmoBGe8AX2PsI8cBFS101vB3mznszA3e2hkHsC3F7X2hNGDGCBeCf9/cZyYnUW4dnBKex9fL3msBbYZkCGI8vZXe0wwspKqQh x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR0201MB1783; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001);SRVR:BY2PR0201MB1783;BCL:0;PCL:0;RULEID:;SRVR:BY2PR0201MB1783; x-forefront-prvs: 095972DF2F x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(377454003)(24454002)(92566002)(2906002)(2950100001)(2900100001)(19580405001)(77096005)(19580395003)(15975445007)(586003)(11100500001)(33656002)(102836003)(3846002)(54356999)(6116002)(5003600100002)(9686002)(50986999)(76176999)(76576001)(106116001)(86362001)(99286002)(5001770100001)(81166006)(122556002)(189998001)(107886002)(3280700002)(10400500002)(5002640100001)(8936002)(74316001)(66066001)(5008740100001)(5004730100002)(87936001)(8676002)(3660700001);DIR:OUT;SFP:1102;SCL:1;SRVR:BY2PR0201MB1783;H:BY2PR0201MB1784.namprd02.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: zend.com X-MS-Exchange-CrossTenant-originalarrivaltime: 31 May 2016 16:39:51.9910 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 32210298-c08b-4829-8097-6b12c025a892 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0201MB1783 Subject: Re: [PHP-DEV] [RFC] Fix inconsistent behavior of $this variable From: dmitry@zend.com (Dmitry Stogov) Hi Richard, $this is still confirm to variable syntax. It's just a special variable. I think, we should keep lexical rules unchanged. Thanks. Dmitry. ________________________________________ From: Fleshgrinder Sent: Tuesday, May 31, 2016 7:19:57 PM To: Dmitry Stogov; internals; Nikita 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.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