Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112557 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 22837 invoked from network); 19 Dec 2020 19:55:19 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 19 Dec 2020 19:55:19 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 58DB11804D1 for ; Sat, 19 Dec 2020 11:27:20 -0800 (PST) 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, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (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, 19 Dec 2020 11:27:19 -0800 (PST) Received: by mail-wr1-f48.google.com with SMTP id t16so6626708wra.3 for ; Sat, 19 Dec 2020 11:27:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=aMvbx2EfD5vYJf/q1mUbrTPGebS7mSKuFWmOXpStOHo=; b=JNBYCvgmMAMPAzNyRA0zRlFK8M9HBY5CVaeLFrP9RA7/oCgSy4ILRXy/8/6sDOu1nc XwyQnwaNw9C6rgF9AJ2mpFap80plBVN32Nc9MAlMlmMVEes4sUmabiF8nw8WmBnQnC+f 7qWtxyBmHTBasrFPfSK9SAcRgeZ7pE7vwBxDHvUxFmkjBfErofgfyUXTuLuKhqsi0Ct0 YPaVK4ALG3H4QLxwm5Fcztg9xUsdh2o0+OY8J2hNWJIx/ahv4ttcKrPd8d86Y1BKjH1L lLbahPjkAKT46XWKIwnAUeIW5OsD5l6AGuCcLmgnnx1TKtN3ORydUssYjzlwjTEO2ORH sXoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=aMvbx2EfD5vYJf/q1mUbrTPGebS7mSKuFWmOXpStOHo=; b=g1ffQGaZA2R79Vj/GeN3Uecc9tWk7JHwnjSNMYXHfy9b1jsCarwxeovaTkOJEkn60R TeoqNYwYp/QLZhJ3Do6zTQXpXAJPA9hp/tDsic+0stOJeyMdHFc7ggYrkY1ZF9vW3w7w YczkykQd8KbA00Uj0t1dc9oVbxH0OMWrbCLH5gsjEiYJjZm2IU0YPpEXTd6as6xdns8A gxzWMnpsP7LNipLMFdvfZcaRSH0nyEy/IjWxCRHR50Frm080DJjXVIhXkimAXXPaaouZ Qpskuc9LbWXnhEBH+sbSZe3et9j56rsc28zHxYCBeLaFAslSESWQYattXzFobKZlBRWJ yh8w== X-Gm-Message-State: AOAM5300I9IHw9LRMjkUYqgbo997+aICI0o2/nal4qD8Y9MQjTtzOldW 3AeoGa8m1W0hnYuE9UoLBteRzBdTZvuZHQ== X-Google-Smtp-Source: ABdhPJxcYvs+Eg0G8ENDpHQYptfjFo1752aNaNJh+HD70xURszMHwQYFMC8k3ZCVRdiMznEzKki4hw== X-Received: by 2002:adf:a3c1:: with SMTP id m1mr10904091wrb.28.1608406037328; Sat, 19 Dec 2020 11:27:17 -0800 (PST) Received: from [192.168.0.22] (cpc104104-brig22-2-0-cust548.3-3.cable.virginm.net. [82.10.58.37]) by smtp.googlemail.com with ESMTPSA id n189sm16271315wmf.20.2020.12.19.11.27.16 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 19 Dec 2020 11:27:16 -0800 (PST) To: internals@lists.php.net References: Message-ID: Date: Sat, 19 Dec 2020 19:27:15 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB Subject: Re: [PHP-DEV] [RFC] #[NamedParameterAlias] Attribute From: rowan.collins@gmail.com (Rowan Tommins) On 19/12/2020 11:28, Benjamin Eberlei wrote: > This is my take on parameter names now being public API, at its future > potential for code maintenance, refactoring and backwards compatibility. > > https://wiki.php.net/rfc/named_parameter_alias_attribute Hi Benjamin, This sounds like a sensible feature. The suggested name seems a bit long, but I'm not quite sure what to replace it with. It just occurred to me that there's a potential connection, in concept if not implementation, with the #[Deprecated] RFC you also just posted: parameter name aliases may well be used to provide a limited-time transition mechanism rather than a permanent feature, so it might be useful to allow them to be marked as deprecated. e.g. // Version 1.0: parameter name is misspelled function doSomething(bool $formatNumters) { ... } // Version 1.1: parameter name changed, old name added as a deprecated alias // if the misspelled name is used, an E_DEPRECATED is raised function doSomething(#[ParameterNameAlias('formatNumters', deprecated: true)] $formatNumbers) { ... } // Version 2.0: alias removed; the misspelled name is now an error function doSomething(#[ParameterNameAlias($formatNumbers) { ... } Regards, -- Rowan Tommins [IMSoP]