Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120291 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 89793 invoked from network); 15 May 2023 18:05:55 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 15 May 2023 18:05:55 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E2E80180539 for ; Mon, 15 May 2023 11:05:52 -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=1.3 required=5.0 tests=BAYES_20,BODY_8BITS, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 15 May 2023 11:05:52 -0700 (PDT) Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-3f427118644so86765405e9.0 for ; Mon, 15 May 2023 11:05:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684173951; x=1686765951; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:user-agent:subject:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=EI/nLpqMV0I9QLgOUPmBLtECMcibmZ45Qabx15n95lg=; b=pRF7LMD1rN/WAZvL4qop8bH86pbZXcotl0L31gOK/pG0RWqoL7UTh9Kr99AYwK508S ynKL7EqvDpMUnHxB3xQ27JBdkwHMfr909Abrg6U9C87Scit1kIByGv+eHD7WXfmuhuls sELDPCFfPcQ3/03zdhFi8kETHkIQ75ChHCt/kDBINn99ntqBEs8MnlDgDwaTAO9qQv35 AkrpG1x8nGHOali+V0wFlnWCjWWQb3MP6/tQUDcyiDxSB3tOfHosDssDeYf0YtaIgAhD uTsvlRJVZzF9p6BAJ89lvBF05E917l5LQYXe/Z8QAAFMkiryIMjyIP0AQ6kpgJOYBssl iwUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684173951; x=1686765951; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:user-agent:subject:to:from:date:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=EI/nLpqMV0I9QLgOUPmBLtECMcibmZ45Qabx15n95lg=; b=iR67LwHKj0Ne02UaoLnS4e2cQt+4nI5nlP+w5PikcxdvDze3AV4GRHnz3s2vQsljA2 fPqP9QVkU7oqQPsM4M6IjIL/QjRPp5GK/gVzX7wp1YmU7FTlpNv7HwDdb0NuExkFIJQo GNSuXAvld7BX/JSwL4a0kWMP1bDv1Wy0090VO66u8ug7KSOfkZcaT3Yg0HLAaWUGf3tg GCtGbRv9+klcMur8W4ihXc+GT30SwHrJJCUkdkpNqlNp/B22tEATjbLsGjvoa33sn00P hjy6EuTR6tShsYG8cJupFa1G+hTKa7WXIqyUTJZLnNShDAbQDYtyEPTAuYXQzijMbUvl j/tA== X-Gm-Message-State: AC+VfDwxk1YD2exw39hfw8lZJchC/B+ajoQP5xVNtwsFSO+Q8VN35jX6 NmX+uZs2FU5YlKaFtHlTXcT3obbaJF8= X-Google-Smtp-Source: ACHHUZ6CZMsV7dHPEMXVkKkJpgAKB+uRD7W+8AFtAV3/8azQRVkPj5V44ngfDJl6iYF/dQdtS9FU1A== X-Received: by 2002:a7b:c4c3:0:b0:3f1:9526:22d4 with SMTP id g3-20020a7bc4c3000000b003f1952622d4mr26378424wmk.21.1684173950655; Mon, 15 May 2023 11:05:50 -0700 (PDT) Received: from [127.0.0.1] (cpc83311-brig21-2-0-cust191.3-3.cable.virginm.net. [86.20.40.192]) by smtp.gmail.com with ESMTPSA id h4-20020adff4c4000000b003078bb639bdsm447261wrp.68.2023.05.15.11.05.49 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 15 May 2023 11:05:49 -0700 (PDT) Date: Mon, 15 May 2023 19:05:48 +0100 To: internals@lists.php.net User-Agent: K-9 Mail for Android In-Reply-To: References: <436378BB-FDFA-43BD-A633-C030C347E683@gmail.com> <359D9C64-52A5-4BF5-91B5-72F7CE116F78@gmail.com> Message-ID: <8D0D9132-7CBB-4EC2-9AB8-0CB1C502A7B3@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC] [Discussion] nameof From: rowan.collins@gmail.com (Rowan Tommins) On 15 May 2023 14:07:31 BST, Lydia de Jongh wrote: >> =2E=2E=2E >> #[SomeAttribute(callback: nameof(\Acme\bar(=2E=2E=2E))] >> =2E=2E=2E > >This callback to nameof()=2E=2E=2E=2E=2E is really terrible =F0=9F=98=A3= =F0=9F=98=A3 Just to be clear, the "callback:" in that example is existing syntax for n= amed parameters, not part of the nameof() syntax=2E A positional parameter = would just look like this: #[SomeAttribute(nameof(\Acme\bar(=2E=2E=2E))] That's the same number of characters as this: #[SomeAttribute(\Acme\bar(=2E=2E=2E)::nameof] The main difference is the the function-ish syntax makes it a bit clearer = what you're asking for the name of, because the whole thing is in parenthes= es=2E There might even be cases where the function-ish syntax needs additio= nal parentheses anyway, like are needed in (new Something)->doSomething() Changing "nameof" to "function", "method", etc depending on type doesn't r= eally add anything, since the output is always a string anyway, not some ty= pe-specific thing=2E Regards, --=20 Rowan Tommins [IMSoP]