Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101232 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 63989 invoked from network); 4 Dec 2017 19:59:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Dec 2017 19:59:44 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.128.172 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.128.172 mail-wr0-f172.google.com Received: from [209.85.128.172] ([209.85.128.172:37179] helo=mail-wr0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 42/F3-28358-F29A52A5 for ; Mon, 04 Dec 2017 14:59:43 -0500 Received: by mail-wr0-f172.google.com with SMTP id k61so18641458wrc.4 for ; Mon, 04 Dec 2017 11:59:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:user-agent:in-reply-to:references:mime-version :content-transfer-encoding:subject:to:from:message-id; bh=1UtT6mQXGJDX8Aoja8/fMg9A5JYf4stzHprAXCeHDC0=; b=qbpons5DPDtLc8uR5uEp2qwiaXRndUpWD/wqdrBHOxSGaucfGVXxldO0nwyCiIt2II d0I0oaPEMMU40lsWim+ngHUBSJ7WqYfgFNNiHq3YoIHyQFFbqzrmYAnYDZLhgSOrElXS 24ahoaylv+nMZJDmX4UQyAuSelbcjBiLJ+XepphQSsxnFrWbUryEOUB7uu2BRXAqUPHx y/t3jjfBNBPOeR7tEOH8J5giapobOXqvlIv5QwHx+xeHW1i6FyF0Eg7LPyFubYwbMDNE EYuQyVbYRLV+tPQ3sh6qpDJwwssdjSNjPa+l+K0cjB7gJUPbMxKZqApcqYZnh+6b67lc E4pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:user-agent:in-reply-to:references :mime-version:content-transfer-encoding:subject:to:from:message-id; bh=1UtT6mQXGJDX8Aoja8/fMg9A5JYf4stzHprAXCeHDC0=; b=iFkK7Lyk11F6WRbn4O635dtNKlowsKdWr4x7a0ELxBE8zKPVZYcyX5a58u7ZziIvTX K71Xq/QSO5ftH5YvejVYl2W2+Qw6e3EQErB06oci2S/YSaLhKSAr9fw40gWzAAkMCdk+ OX2haTfVeblw7KAb8j4Sg3kau2fN/MZ1+FopwMXlxi4tf4QIu/jponMBVbvbVxIbzMZ2 5R7G6A0JeS60FWwVgs+27Ue2JRF3OZ8q3LmDMaxk+Ro4i7rLEpp3CX95PeqSl02D32OP CA/eThtOyjzI2PFqZrsu8YvZsoeKpsstSA1rVVIm5NTPWjXyQ9oCbQOfynZjEfRz519f QpiQ== X-Gm-Message-State: AJaThX6sZ6I/bzaNLtYGec2+xsztret0FgG+iXabHQ55oeP7YjLimjWD vXe9vWJjdi/DPA2O169Tbf37Sw== X-Google-Smtp-Source: AGs4zMasQW3vPU8NhgOU3Di58JMBCrwUhiRD8vvG5nX09EzLe8bV5GC9cZ5Mr7xrYb5cXtFjDOCXbA== X-Received: by 10.223.136.80 with SMTP id e16mr15199130wre.21.1512417579541; Mon, 04 Dec 2017 11:59:39 -0800 (PST) Received: from ?IPv6:2a00:23c4:4b81:ae00:f8e9:c6ba:9fd7:e97b? ([2a00:23c4:4b81:ae00:f8e9:c6ba:9fd7:e97b]) by smtp.gmail.com with ESMTPSA id o2sm8365034wmf.27.2017.12.04.11.59.38 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Dec 2017 11:59:38 -0800 (PST) Date: Mon, 04 Dec 2017 19:59:32 +0000 User-Agent: K-9 Mail for Android In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable To: internals@lists.php.net Message-ID: <9512FDD8-FF77-49CD-898E-B9D375524250@gmail.com> Subject: Re: [PHP-DEV] Use-case for `use`ing the same trait multiple times in the same class? From: rowan.collins@gmail.com (Rowan Collins) On 4 December 2017 17:26:12 GMT+00:00, Levi Morrison wrot= e: > Using `T::get as get2` still conflicts because that >*aliases* even though most literature says it renames=2E Funnily enough, I was just recently wondering why exactly that was, and co= uldn't find much of an answer=2E The RFC rather vaguely says that it would = cause problems with dynamic dispatch, but it's not obvious to me why using = "insteadof" to replace an inherited or locally declared method would be any= different from using it to choose between two traits=2E However, even if that limitation wasn't present, I can't see a use case fo= r *directly* using the same trait twice in one class=2E I say directly, bec= ause even now you can *indirectly* introduce a trait twice, via inheritance= of either the class or the trait=2E trait A { function foo() {} } trait B { use A; function bar() {} } trait C { use A; function baz() {} } class X { use B, C { B::foo insteadof C; } } class Y extends X { use A; } Regards, --=20 Rowan Collins [IMSoP]