Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112559 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 30330 invoked from network); 19 Dec 2020 21:25:00 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 19 Dec 2020 21:25:00 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id BC1BC1804E4 for ; Sat, 19 Dec 2020 12:57:00 -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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (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 12:56:59 -0800 (PST) Received: by mail-wr1-f51.google.com with SMTP id a12so6737378wrv.8 for ; Sat, 19 Dec 2020 12:56:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beberlei-de.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=mYAkKjb1QlD4ghS5RD1R4FWUk1Ii9znLsYwPxm8AYCw=; b=SlYHLexw6gAi+qH4vjqyO1oN7G8sMhIxPI/FSksPTt+4rcflbw0+MoRcUyiG3mayKe Cpat6VJiNCr/cl5zzvwsHBiSvwrwYtk3l0qMwB+XflQ+WbnqI03tbSwZ9wSnumOEBhZo L0N/EI9Kbj+dvquJcF/TjXmke3Y83Edh2X4FxiiX3UsnZWnUs1qYOweL1IBgnMM6W5pL ifYjAP7YmvvcVCYpoqfGBUOelU/QvRR/rfViwl0+1gpCeoyGRVVbRDqnOyMeMl4Lvx34 iQI94UNcroAlzBbBlhsmpu00VlqWzr1hYl8136MCcCD3VCmygLtaxTJuTAvPTDv9aXLi R6pA== 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=mYAkKjb1QlD4ghS5RD1R4FWUk1Ii9znLsYwPxm8AYCw=; b=QcJ5QvhkwkVxVIhhm+rZXn67peL++JXdfSZoDuO9TAMw8tYO7EVKod711GLuliapG/ KBN0ber5bd/N0XZK3JO5IxVUqO4qK0/opcS7ltH2X6E7pyylwzbWBncd87BNhdkTGOtN 5m5lqgMAFmW4YbrmAOuDfjbLA/TKhvtyZkqjnexLbbd3611otXixUtYPPQ3EQhmEXE3r 0dsz34G7Zt4aHqRH+rjJx+RD97/APWWXt6B3Y2NScepnp0xdaFE351kamupjwg+I2TMX 3PwI3KBQxZWxEr5PyzTh3HhRrU5cd43oU++0YPEMYCGRRpSEvFqNNzhoSs9EGl16lnRQ HODw== X-Gm-Message-State: AOAM532W7zmN9dVmlLWEc/p9sTMjt8wHmRjU72Qg3mgq8N1VXoDWW7IE P11SHR9lm/fnrmLhjlvNCNelV9AVX1qUtJ0eoceRRg== X-Google-Smtp-Source: ABdhPJz9iX8rDZFVQvzuzNUcxIpHpJvv5ZDP88Qu84FXesr8/809ACqFNIRawUREXNJd+Gl0Srsi00XZh2DMS6UWDxI= X-Received: by 2002:a5d:52c1:: with SMTP id r1mr10788846wrv.255.1608411416964; Sat, 19 Dec 2020 12:56:56 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Sat, 19 Dec 2020 21:56:45 +0100 Message-ID: To: Rowan Tommins Cc: PHP Internals Content-Type: multipart/alternative; boundary="000000000000293e3405b6d777b4" Subject: Re: [PHP-DEV] [RFC] #[NamedParameterAlias] Attribute From: kontakt@beberlei.de (Benjamin Eberlei) --000000000000293e3405b6d777b4 Content-Type: text/plain; charset="UTF-8" On Sat, Dec 19, 2020 at 8:27 PM Rowan Tommins wrote: > 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) { ... } > Oh that is a great idea! It makes sense to allow developers to mark the alias as the deprecated parameter name. I will add this to the RFC on my next iteration. > > > Regards, > > -- > Rowan Tommins > [IMSoP] > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php > > --000000000000293e3405b6d777b4--