Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110740 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 95781 invoked from network); 27 Jun 2020 11:41:05 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 27 Jun 2020 11:41:05 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 6870F1804C8 for ; Sat, 27 Jun 2020 03:29:15 -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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sat, 27 Jun 2020 03:29:14 -0700 (PDT) Received: by mail-lf1-f44.google.com with SMTP id k15so6450380lfc.4 for ; Sat, 27 Jun 2020 03:29:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=enQjYyOTO11WnsJQJjH7tgrZ1HVbzLNcPqBRWK5SLcc=; b=Ofn3VSrHnfTzZ1T0h2G6gEfeqTE8t13v9EG08G66omV8DGnJb3pLFGWxaepMw8BCtM mM/P5PqVQumtKB7fp5PQ2gqtzRdCRzxn1UJpLauAcmNIIK6rgehwJHpFoT/3fLwryAMt dlbpNCBlqZ8dNshu4K8EO+TM2B0+BAgx7+PhbpA3mm7CE3qLK9udzLalfC0bgw3ViIbs vXc3++QciP//D4jIWD3XHX6j7YLZQ1AGgA8sstUwnr9f4zMSXcdr3qrwsoI8EHR6ZuAk 5JTHJaRQPaFmHR8HLyw1qisCHnJN/l1nX51ulTekSJoZSuQYXPpCX1ih+gzlEb9P3i9i tD1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=enQjYyOTO11WnsJQJjH7tgrZ1HVbzLNcPqBRWK5SLcc=; b=TKeYuwL3C5Ud3axgyFw9y1SZZZ5TT8la7RDw962njg+AypE8AoUIlnBNEz+oN2Tu4u 2t4ui6uXczJGnd12dD51A5mnbwmjsmqzH2jTN6g/b5e+bW4kBHGxPFMKbAoddaJspR97 g10ych6/go3Lm2XkQprgQSO/c5t98Vj2QPkD7E7S2x9CXtv1mzkL9V1UBkyXziLSOx0g BzDala9PM38jOGG7Rra3Aup7+Lo4QPD9AZ9mCge/JC4LhUX6HBSK4k3qh3D2J7oM1SXr 4cIaXwm7J3sZrCsD0SK30mumXGL+/o/Yc+vZCUVGYYzFAxH8g9DlWEXMS7X1yhjOKp3g 0nNw== X-Gm-Message-State: AOAM530XRTwQhPB5GKigkQu1jofE7sk0OHVzJfU7HcV91L5f3s5hg+RM Wf2dq5TB4yD/j6VLH+219G5zeDqGJp+NBYcumKM= X-Google-Smtp-Source: ABdhPJx3NGy/+F6JgOZbgaMk0eiYRKTPVbmi+fvEm4sYJrBF/CvKQBRW8LuzYZpqk3piGOwle2xuRiOsyt7yKiLMAyY= X-Received: by 2002:a19:bed7:: with SMTP id o206mr4310668lff.81.1593253751009; Sat, 27 Jun 2020 03:29:11 -0700 (PDT) MIME-Version: 1.0 References: <5ef71801.1c69fb81.68596.376aSMTPIN_ADDED_MISSING@mx.google.com> In-Reply-To: <5ef71801.1c69fb81.68596.376aSMTPIN_ADDED_MISSING@mx.google.com> Date: Sat, 27 Jun 2020 12:28:54 +0200 Message-ID: To: Andrea Faulds Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000ddb57f05a90e4b5a" Subject: Re: [PHP-DEV][RFC][VOTE] Rename T_PAAMAYIM_NEKUDOTAYIM to T_DOUBLE_COLON From: nikita.ppv@gmail.com (Nikita Popov) --000000000000ddb57f05a90e4b5a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Jun 27, 2020 at 11:57 AM Andrea Faulds wrote: > Hi, > > G. P. B. wrote: > > https://wiki.php.net/rfc/rename-double-colon-token > > I have voted No to this, and I hope I can convince some others to do the > same. > > T_PAAMAYIM_NEKUDOTAYIM is such a famous token that there is probably > nobody in internals who doesn't know what it means, and for new > contributors, it is easy to find the definition, and note that it is > hardly the only token name that they will need to look up. It is also a > fun nod to the history of PHP, and I think it would be a shame to lose > that. > > I mention the internals usage first and foremost, because it should be > remembered that token names are merely an implementation detail of the > PHP interpreter, unless you're using token_get_all (which by the way > already has the alias T_DOUBLE_COLON). In other words, it's not > something the vast majority of userland developers should ever encounter > or have to think about. > > Of course, if T_PAAMAYIM_NEKUDOTAYIM was never encountered by userland > developers, this RFC wouldn't exist. The thing is, I don't think > T_DOUBLE_COLON should be encountered by userland developers either =E2=80= =94 in > my view, as an implementation detail, token names shouldn't be part of > parser error messages at all. If we were to remove token names from the > parser errors, we would avoid the problem this RFC seeks to solve. For > most tokens we could simply display the characters it corresponds to > (e.g. "::" for T_PAAMAYIM_NEKUDOTAYIM, which we already do!), and for > those with variable content (e.g. T_STRING) we could display a > human-readable description of what is expected (e.g. "an identifier"). > > I think the case for not renaming T_PAAMAYIM_NEKUDOTAYIM, and instead > improving the error messages, is stronger when you consider that is not > the only token with a name that might confuse people outside internals. > For example, T_STRING is a very common token, but the name is probably > going to surprise most userland developers who encounter it in an error > message, because it doesn't mean a literal string. Even for tokens with > more conventional names, it is unnecessary extra information. I think > renaming just T_PAAMAYIM_NEKUDOTAYIM is not a full solution to the > problem this RFC intends to solve. > > Apropos of that: > > > We did acknowledge the suggestion of dropping the token name from the > > error message directly, but in our opinion this is an orthogonal > > change to the one proposed, and has the risk of not landing in PHP > > 8.0. > > Is PHP 8.0 an all-important? If we _don't_ rename the tokens, but simply > improve the error message, that might be allowable in a patch release > (e.g. 8.0.1). > > (I also don't think we should rush things if we are unsure about them, > given the consequences that has had in the past.) > > Thanks, > Andrea > Hey Andrea, You convinced me! To vote "yes" on this RFC :P I initially thought that this proposal is simply redundant, because the issue would be fully addressed by a) not displaying token names in errors, which I expect to happen for PHP 8.0, and b) renaming T_PAAMAYIM_NEKUDOTAYIM as far as internal usage is concerned, which is an implementation detail on which internals@ input is not required= , but I now realize that there might be friction on point b) without this RFC, so it is better to accept it. Regards, Nikita --000000000000ddb57f05a90e4b5a--