Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108823 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 74942 invoked from network); 3 Mar 2020 15:52:37 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 3 Mar 2020 15:52:37 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 94E171804E0 for ; Tue, 3 Mar 2020 06:11:46 -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,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-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) (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 ; Tue, 3 Mar 2020 06:11:46 -0800 (PST) Received: by mail-lf1-f49.google.com with SMTP id s1so2885641lfd.3 for ; Tue, 03 Mar 2020 06:11:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=75GQV3DOCHiNHiW+8ek+tKfF7DyXQcmbNMtYInk8fao=; b=F0wgVynHm1SMMwglv9J5QKO9ZF5HCcxKLlmi4xHh7gxi1F3ia9E/dCbzYWIe+ihDJy xYkrof1SkreIyo90PXjU6yOmKEck5xWCeK5e0OY7MnMUZCC/n9wWydeZ65vCmgqaaMls nIzu0+NMOPvIE8XkXRnllf+NJgYJTnmXO4GYtiU3iA9j3mcMdMfWBSnvh2XzGeEbQC6A oSEt9CQ9j8/ISjyNgTGB5/o7s9HqtiuXHBnW4eSQZveV8b5CNdn0JINYX7PSc81pVVxy 6IZ6sU1YIKsx4qyfOztSLy/QJHeKvqWjmcbo81O4awhIYr7RBOKgnH1quwg/J+MYPhRk AvCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=75GQV3DOCHiNHiW+8ek+tKfF7DyXQcmbNMtYInk8fao=; b=t8sLf89WESs1FgYNTpbZncNfAVPs9QESxaKhSrTGvk4uN2lfRDai2G4vfLY+d/8hCf B5Q0GTgu0p8QsK/gg6j3UHZXPPNTGtypmgUjIWti+dOcRFdcR79oSXMr9sjmWwh6j/bD uyS3vNp6LGin56YmW8zkPJI8mnCsaTwzTtqI/pdnfCAJNKihwZshbK8IHj4KBffZNvSz yGtLW1hlqMcZ6Qf+BxS0Dt+/T4cyTs8KUEjqtbahqGRJyn6ZI2FA11GtUfREo+4wKEcn Mm7Oq9zkls4YxaNQT2DRBP2Wi6UWUe9m7Fq/2SmTD47rETkHk88G+a6m0pmUPmHabnab QT1Q== X-Gm-Message-State: ANhLgQ0Xh3CYRYFvsQ55ZE86+uRvNXap5agl+73cKj/huQGphOtT8iLs OpnouRMDvb/7HgMPASSY5MQQK4V2sFdKEGvVvRR4Oze9f3Y= X-Google-Smtp-Source: ADFU+vve0sN3/Mnp/Bzcku98uXbscSjxprERRtYJUrSWQMCe6TJzW+bP8l44rhDEIp7HVt01Xh8Ukux2+GM4f9rwveI= X-Received: by 2002:ac2:51c9:: with SMTP id u9mr1747701lfm.191.1583244703318; Tue, 03 Mar 2020 06:11:43 -0800 (PST) MIME-Version: 1.0 Date: Tue, 3 Mar 2020 15:11:27 +0100 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="000000000000224c1a059ff3e264" Subject: Require non-absolute trait method references to be unambiguous From: nikita.ppv@gmail.com (Nikita Popov) --000000000000224c1a059ff3e264 Content-Type: text/plain; charset="UTF-8" Hi internals, Currently, when writing something like use T1, T2 { func as renamedFunc; } where both T1::func() and T2::func() exist, we silently allow this and just assume that it is referring to T1::func(). See https://3v4l.org/6h3PM for a more complete example. I would like to make this an error in PHP 8: > Fatal error: An alias was defined for method func(), which exists in both T1 and T2. Use T1::func or T2::func to resolve the ambiguity in %s As the error message indicates, the ambiguity is resolved by writing use T1, T2 { T1::func as renamedFunc; // or T2::func as renamedFunc; } depending on which of those you actually meant. This is implemented in https://github.com/php/php-src/pull/5232. Does anyone see an issue with making this change? Regards, Nikita --000000000000224c1a059ff3e264--