Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108831 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 97888 invoked from network); 3 Mar 2020 17:38:56 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 3 Mar 2020 17:38:56 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2305B1804D8 for ; Tue, 3 Mar 2020 07:58:07 -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.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, 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-qk1-f175.google.com (mail-qk1-f175.google.com [209.85.222.175]) (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 07:58:06 -0800 (PST) Received: by mail-qk1-f175.google.com with SMTP id e11so3083128qkg.9 for ; Tue, 03 Mar 2020 07:58:06 -0800 (PST) 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:reply-to :from:date:message-id:subject:to:cc; bh=LUqKJBbx75yt1ORQQS1mWKev+PvibkZKePz+wID4BTQ=; b=hmla4U15/Q/IpE2f3VbTx5EpwfQ2E6WLx8NHaLFUKV7FuVmt4kWd59uYlvCU00D9TV tzBLNSZTPP7VdxErEhBQDEam+1Wq+VX0FbP+yZXCK6GmlQlI9S0jteS+eik6LtuyAd/z sTVZR2mY0nEsjkRlM9p2l+pWFAOhXpQQJ4wH/lUk8Tsg2NdNWDquwc/FxvGKC8F+K7As 2dftG0Komv7Q3HV+hWnbxwtXS3Ce5vkq+fxkurcr+oGHb2yUgNuBaKeqPmwQmThJlYsb 1R+nUD6IIjD7T9WNBdGnSKxgCZX5sdS3ElaLbvqpWqZ9janAxP5wYrlECotQvoJYh1F3 VWJQ== X-Gm-Message-State: ANhLgQ26U6/ehRGmvpxe1gj+sxXMoo7OKIrHPrsTR2xlC28h/DcMfeZB ajyDlOzrE2VtDcfyLG5fepPopYjATFNCb7OWpWA= X-Google-Smtp-Source: ADFU+vu5RKuK1R6o0JZpLK4jj1GK2KthK7akYquBMK94I1ws7CksC+8rN7IqbPcU5kHdzVDFtKm5Fr4t/twgTM8UzXI= X-Received: by 2002:a37:8384:: with SMTP id f126mr4277655qkd.99.1583251083754; Tue, 03 Mar 2020 07:58:03 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Reply-To: bishop@php.net Date: Tue, 3 Mar 2020 10:57:27 -0500 Message-ID: To: Nikita Popov Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000700095059ff55efe" Subject: Re: [PHP-DEV] Require non-absolute trait method references to be unambiguous From: bishop@php.net (Bishop Bettini) --000000000000700095059ff55efe Content-Type: text/plain; charset="UTF-8" On Tue, Mar 3, 2020 at 9:11 AM Nikita Popov wrote: > 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? > None. The break here doesn't seem to be wide spread, the error is clear to me, and it has an easy remedy that may be made in PHP 7 installs today. Thanks for fixing this! --000000000000700095059ff55efe--