Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110477 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 88690 invoked from network); 11 Jun 2020 10:01:09 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 11 Jun 2020 10:01:09 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A72041804DC for ; Thu, 11 Jun 2020 01:45:14 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,SPF_PASS, T_SPF_HELO_TEMPERROR autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS8943 85.119.80.0/21 X-Spam-Virus: No X-Envelope-From: Received: from mail.apserver.co.uk (server2.alteredperspective.co.uk [85.119.82.103]) by php-smtp4.php.net (Postfix) with ESMTP for ; Thu, 11 Jun 2020 01:45:11 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by mail.apserver.co.uk (Postfix) with ESMTP id 47DCA4F4064; Thu, 11 Jun 2020 09:43:42 +0100 (BST) Received: from mail.apserver.co.uk ([127.0.0.1]) by localhost (server2.alteredperspective.co.uk [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 7nYNP6yP-HQO; Thu, 11 Jun 2020 09:43:40 +0100 (BST) Received: from [192.168.0.8] (cpc113420-maid7-2-0-cust1808.20-1.cable.virginm.net [86.18.119.17]) by mail.apserver.co.uk (Postfix) with ESMTPA id 61B7B4F4061; Thu, 11 Jun 2020 09:43:40 +0100 (BST) To: "G. P. B." , PHP internals , Kalle Sommer Nielsen References: Message-ID: <1914c612-99ef-5c12-0409-37424c071220@allenjb.me.uk> Date: Thu, 11 Jun 2020 09:45:04 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB Subject: Re: [PHP-DEV][RFC] Rename T_PAAMAYIM_NEKUDOTAYIM to T_DOUBLE_COLON From: php.lists@allenjb.me.uk (AllenJB) On 10/06/2020 16:13, G. P. B. wrote: > Greetings PHP internals, > > Kalle Sommer Nielsen and myself are proposing to rename the > T_PAAMAYIM_NEKUDOTAYIM > token into the already existing T_DOUBLE_COLON alias, > T_PAAMAYIM_NEKUDOTAYIM would then become an alias to T_DOUBLE_COLON. > > The RFC is located here: https://wiki.php.net/rfc/rename-double-colon-token > > Although this token is a nod to the valuable contributions made by the > Isrealie community we believe this token is rather confusing for newcomers. > Moreso, as PHP is for many people their first programming language, > they may not have some of the habits like googling errors when > they are stuck, which leads to a frustrating experience. > > As we believe PHP still has many years of existence we think it is time > to rename this token. > > This is backwards compatible with PHP 7 and 5. > This RFC does not lay out a plan for deprecating T_PAAMAYIM_NEKUDOTAYIM > and leaves this as a future scope. > > As the matter on hand is a relatively straight forward yes/no vote we expect > it to be held after the minimum 2 week discussion period. > > Best regards > > George Peter Banyard Either as an alternative, or as an "as well as" option: I think a better way to improve parser error messages would be to include the point in the line where the parser error occurred.  This would additionally help where a token appears multiple times on the same line. This could be either as: a) Character count (at line 456, character 23) b) Quote either the remainder or the parsed section on the line (MySQL quotes the remainder, for example) c) Quote the whole line with an indicator where the error occurred. I'm not sure what the best way to do this would be - generically this could be encapsulated in several values: The line content, token start character count, token length / end character count A case where I can see this still not helping is cases where the parse error can occur several lines after the actual error (or even at the end of the file) due to things like missing  quotes / braces. AllenJB