Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109587 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 75068 invoked from network); 10 Apr 2020 21:31:37 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 10 Apr 2020 21:31:37 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id EDB641804C7 for ; Fri, 10 Apr 2020 13:00:20 -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.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, 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-lj1-f172.google.com (mail-lj1-f172.google.com [209.85.208.172]) (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 ; Fri, 10 Apr 2020 13:00:20 -0700 (PDT) Received: by mail-lj1-f172.google.com with SMTP id h25so3002938lja.10 for ; Fri, 10 Apr 2020 13:00:20 -0700 (PDT) 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=sbFDX6TaXr76tkJ8qS4jktEShMxAFNu1FhJoD7MgSTI=; b=GScrhWXpQic1HMHxMI7fXDyA88zgDOcEPhoN22ezJc4avgqGftrGkKl2heZbKqeqi/ e508wA8vKCz/QebHS6bjMmeDx5BJgrCUH8w3J9TxZ2/FhrnFDWdtmF678oqTz0tnRIq8 B3JBepSG7SNtALcFjel6cPF7klbKyEmu37lKyQrBwn3pG780Cb8MaVKYQHwW2SnUOs1l 1LMDnfb+5z2OIiLwJoFLoAvWa22VD01U5VYGMtqKi+IwTSWLnlI9huM7KEm8q9U2qtsi +hSb03OEpqlGnBRDWhEYCmPeWzvjYOfpyL2mKvanlOdHeM/56uFcX2ko7upm7eum89lo 5LMw== X-Gm-Message-State: AGi0PuYkReZIy4ohwjHeym5kNGeWEJvVUHOzjnE4rNWzrZBHYDywlOAB bvqQTOa9YcZ+wnQRFbZquSBJ+2RRPXbghZd/ok4= X-Google-Smtp-Source: APiQypIu8lHbVkAs9ExWWn2FlE3ZQMNdRJhIouD6IjlQKQTQ/NqcEYUvwJa+zwSBnUU2QJp+N+HVQSBJUafJOpJ97B8= X-Received: by 2002:a2e:851a:: with SMTP id j26mr3959974lji.27.1586548817870; Fri, 10 Apr 2020 13:00:17 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 10 Apr 2020 22:00:06 +0200 Message-ID: To: Nikita Popov Cc: PHP internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] Resurrecting named parameters From: jakob@givoni.dk (Jakob Givoni) On Tue, Apr 7, 2020 at 2:45 PM Nikita Popov wrote: > > ## LSP checks for parameter names > > Parameter names currently have no particular significance in PHP, only > their position in the signature is important. If named parameters are > introduced (in a way that does not require opt-in at the declaration-site), > then parameter names become significant. This means that changing a > parameter name during inheritance constitutes an LSP violation (for > non-constructor methods). There are a number of ways in which this issue > may be approached: > > 1. Silently ignore the problem. No diagnostic is issued when a parameter > name is changed during inheritance. An error exception will be thrown when > trying to use the (now) unknown parameter name. I prefer this approach. It might seem inelegant at first but I believe none of the other options will do us any real favors, especially stronger LSP enforcement on the language level. And opt-in seems like a non-starter for reasons Rowan Tommins lay out (though he's in favor :-) Dev side tools will be fully able to "deal" with the downfall.