Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91496 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 4690 invoked from network); 4 Mar 2016 10:07:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Mar 2016 10:07:57 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.51 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.51 mail-wm0-f51.google.com Received: from [74.125.82.51] ([74.125.82.51:35821] helo=mail-wm0-f51.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 33/6C-08749-B7E59D65 for ; Fri, 04 Mar 2016 05:07:56 -0500 Received: by mail-wm0-f51.google.com with SMTP id l68so27430035wml.0 for ; Fri, 04 Mar 2016 02:07:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to; bh=DnitGennQM5PWCkKG5Kxixe1fhXV91BmIafcavBWT5o=; b=Et2FLcIUUoS2anUhumAhTr41rV7MmMwddj7rZ0vqwfvcAr+uFYYTjGvuORWddQNo0H IaHFlypud7N6IyEdMogTDrP1JbAE+OYAgfT15XAAlNjkgVf+BfNpocxjP+lRURZS5pLa ifDOPHklZWRDRMZNsMTD4DMzr6mhFMx6Rrc0qnVM/sm5xW1Ov02Rk5S4ESnQK8xjFsHa Wrp8Oui03RaYSsPKj59tjNBR6Aik+VOqfP0qwsmtBIaHn2FhxisWJF2coMWw8JV/NEVQ xGTt1qVfoEqY7nkBtS6ogHDL3lKSoQbexy3z3LPFeQbfSjPktxYW2o9d27QWO/Xz+d2+ HxYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to; bh=DnitGennQM5PWCkKG5Kxixe1fhXV91BmIafcavBWT5o=; b=lIyTVC4S7fa3bgdjt5v3QEr8XPgWEh17SPqsdEbuArzhaFMX7BztL8RLhcfBkSo489 xErj9i352PHIdQ28Wn0CSIEraH3Ushcqbqbyoua2bIyP+jA9cF5szA1hCIcVT136mTOL WYkKacm9fmNfMJ8s6zlwHMHPGuxX1p+dwR/C0jvtTt2ILeYtH/NJNhVUd+ys6xnLiIGC 97h7t2qrXC0LeiNM/dTZ+CvGntAMMuQcY3fJoZ/8u18UgV+M38xIwykyBYN2tPoYYct9 7N3Q/3/KQUnpzv1DNbE5kmWycvQnXnza8mh/h1T0xkLobq/qQaRCRxMPr5CJxo3+r9jY Vyag== X-Gm-Message-State: AD7BkJLnKAGk8UpsthMMz19vdx9h86MzEl3QKqOJlEaPz3QWU7oav3nnjC8K9IyUsrY8sg== X-Received: by 10.194.184.112 with SMTP id et16mr8180122wjc.75.1457086072851; Fri, 04 Mar 2016 02:07:52 -0800 (PST) Received: from [192.168.0.141] ([93.188.182.58]) by smtp.googlemail.com with ESMTPSA id i5sm2561197wja.23.2016.03.04.02.07.51 for (version=TLSv1/SSLv3 cipher=OTHER); Fri, 04 Mar 2016 02:07:52 -0800 (PST) To: internals@lists.php.net References: <94.96.08749.188B8D65@pb1.pair.com> Message-ID: <56D95E18.9020007@gmail.com> Date: Fri, 4 Mar 2016 10:06:16 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------080605010600000701070407" Subject: Re: [PHP-DEV] Re: [RFC] Traits with interfaces From: rowan.collins@gmail.com (Rowan Collins) --------------080605010600000701070407 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Davey Shafik wrote on 04/03/2016 07:17: > 1. If you simply alias (use foo { bar as bat; }) then you end up with an > *additional* method with the new name, the trait method as defined is still > brought in, and_will_ override inherited methods of the same name. Here's a clearer example of this: https://3v4l.org/RKHPt Unfortunately, you can't even use "insteadof" to directly bring the parent method back in [https://3v4l.org/qOS5T], but you can stub it out with a direct call to parent:: [https://3v4l.org/s9i4N]. > 3. Doing this (visibility + name)_only_ gives you the new method, which is > _different_ behavior to #1 I can't reproduce this: if I say "bar as private bat", the trait's bar still shows up, and is public, just as in the previous example: https://3v4l.org/1jH6o Your examples are rather confusing because they are effectively applying the same trait twice, at different levels of the hierarchy; I'm not sure this is a particularly likely scenario, or relevant to how interfaces should behave. Regards, -- Rowan Collins [IMSoP] --------------080605010600000701070407--