Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91352 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15379 invoked from network); 23 Feb 2016 00:37:35 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Feb 2016 00:37:35 -0000 Authentication-Results: pb1.pair.com smtp.mail=bowersbros@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=bowersbros@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.41 as permitted sender) X-PHP-List-Original-Sender: bowersbros@gmail.com X-Host-Fingerprint: 209.85.215.41 mail-lf0-f41.google.com Received: from [209.85.215.41] ([209.85.215.41:34287] helo=mail-lf0-f41.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 78/BC-25165-EC9ABC65 for ; Mon, 22 Feb 2016 19:37:34 -0500 Received: by mail-lf0-f41.google.com with SMTP id j78so105075868lfb.1 for ; Mon, 22 Feb 2016 16:37:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Fx3c0d9fnlCx/29hPa0nSlMx35c/CCh5I7wdFSrjgQk=; b=gF0GITVDx1Bq16IdTLInqqG+7SPLAMSk177cgAFpvh74ix+qo9oSL4Pk03/log2XhP 2fVhd2Ex2ifQJ7zS3hB2MOAfNOc0A2H2iowKIbSQivzKVtOnVpG2nlwT3pTUuzCpeA8X 1dPb5VOMKQX480LsOOc8UUfaDCTqRd6oesL/0370T6lKOyFbT2gcpBDKLInUybHkxBsn 7kVFdaMusw6MVYRV46iljqIl7T7Hk4dOXEKlp4znW58o0tHFIDH1j9NsQm++6Jo0OXaq uIcPOViuOIjzdJg5er8DCTTVFo5PxOOWbJED3ooEnc8B7KDaH7LD3aqH5JhyGhdRPI0p p68Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=Fx3c0d9fnlCx/29hPa0nSlMx35c/CCh5I7wdFSrjgQk=; b=mc722ni+ginxmAO5j0byBhjOOEAKKJKVEhDZBy9D+7NKH6a5UZxjrcooAjmD3DejSb 3o1nTDKkCiRZDAYEJNmjdHGmUpoKH2fK8rPG9ybLGrNhyESXcrGjl03TKe/EuC+Sruhf dKG6IMKo4TMZd2gKw+5S/JFPdOZ//08lUUG+Egw/MY6Y7ztEbPEThmgqoOvjhJQIu+0L 2jsr8zvRuJIJ/TuZOKaRV1vn45rJsywcbnNNDeohX6oFwlvnORDmM3MgX6flbiBgrnXG 1fPDyWtVQURSHJOEImLomt5r8nTtRLs8LXblZA/FGsHob5/8l4378pvrv8kJrC+2Qcje LJmQ== X-Gm-Message-State: AG10YOQlnsg0jVv6fWYXm2nkVdz0GfJIT+dVpJKdxUO56k6vGqMLRz4qTrr8w2303UFQWVyaxshCfJYeSfb24g== MIME-Version: 1.0 X-Received: by 10.25.24.68 with SMTP id o65mr8972628lfi.156.1456187850505; Mon, 22 Feb 2016 16:37:30 -0800 (PST) Received: by 10.25.214.20 with HTTP; Mon, 22 Feb 2016 16:37:29 -0800 (PST) Received: by 10.25.214.20 with HTTP; Mon, 22 Feb 2016 16:37:29 -0800 (PST) In-Reply-To: References: Date: Tue, 23 Feb 2016 00:37:29 +0000 Message-ID: To: Kevin Gessner Cc: PHP Internals Content-Type: multipart/alternative; boundary=001a11401e288e4683052c65277d Subject: Re: [PHP-DEV] Re: [RFC] Traits with interfaces From: bowersbros@gmail.com (Alex Bowers) --001a11401e288e4683052c65277d Content-Type: text/plain; charset=UTF-8 Would a fair solution to this be having the using class define whether to inherit the implementations? Perhaps a new keyword akin to 'propagated', so the code will read Class Foo { Use propagated TraitName; } Only then will the implementations from that trait bubble through. If it isn't declared then the implementations are not visible. This should keep all backwards compatibility and keep code readable since now we can immediately tell which traits being used do we want the implementations for in the main class. On 22 Feb 2016 20:19, "Kevin Gessner" wrote: > On Thu, Feb 18, 2016 at 4:13 PM, Kevin Gessner wrote: > > > On Wed, Feb 17, 2016 at 2:05 PM, Kevin Gessner > wrote: > > > >> I've created a proper RFC wiki page here with the draft: > >> https://wiki.php.net/rfc/traits-with-interfaces > >> > >> It includes more detail and several example code snippets. Thanks all > >> for your feedback so far. > >> > > > > I've just updated the RFC to v0.2, presenting two proposals to be voted > > separately: one to allow traits to declare and implement interfaces, and > a > > second (dependent on the first) to propagate interface declarations from > > traits to classes. > > > > I've created a php-src pull request for Proposal 1 of the RFC, allowing > traits to declare and implement interfaces: > https://github.com/php/php-src/pull/1773 > > Reviews and feedback welcome! > > I haven't yet started on an implementation for Proposal 2. > > Cheers > -- Kevin > --001a11401e288e4683052c65277d--