Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54139 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 72450 invoked from network); 22 Jul 2011 16:25:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Jul 2011 16:25:31 -0000 Authentication-Results: pb1.pair.com header.from=ircmaxell@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ircmaxell@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.210.44 as permitted sender) X-PHP-List-Original-Sender: ircmaxell@gmail.com X-Host-Fingerprint: 209.85.210.44 mail-pz0-f44.google.com Received: from [209.85.210.44] ([209.85.210.44:56831] helo=mail-pz0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E3/A0-03772-774A92E4 for ; Fri, 22 Jul 2011 12:25:28 -0400 Received: by mail-pz0-f44.google.com with SMTP id 5so4398500pzk.31 for ; Fri, 22 Jul 2011 09:25:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=chKglSFI9EqArQaIK09qPJOrjWZ7ECa8Eeo/RCyiS4o=; b=wsmgZShUcl9RFxlQhNNy+u/TIFLWeAkV5q7cmQCxMRRWNcKe3ygAUe81DdljAF0lfZ jyKa10EdwisYW+50Xh9SwBNj1+1+BPa3nt2oXOucHhWecMvWOUw5JINJ9102CPUOKAlo 8BKEkmyw2guH1pcgbKB8BnNoT2fyS4YKGpriU= MIME-Version: 1.0 Received: by 10.68.56.10 with SMTP id w10mr2560624pbp.329.1311351926651; Fri, 22 Jul 2011 09:25:26 -0700 (PDT) Received: by 10.68.62.2 with HTTP; Fri, 22 Jul 2011 09:25:26 -0700 (PDT) In-Reply-To: References: <4E29949C.9020209@gmail.com> <4E29A164.3070108@gmail.com> Date: Fri, 22 Jul 2011 12:25:26 -0400 Message-ID: To: Adam Harvey Cc: Alex Howansky , internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] 5.4a2 trait attribute name conflict resolution From: ircmaxell@gmail.com (Anthony Ferrara) > Traits definitely need to be able to support properties, IMO Well, if traits support properties, they stop being traits and become mixins. A trait is nothing more than a mixin that does not have a state (so no properties). I'm not saying that it wouldn't be useful to contain properties (and hence state), but the RFC was for traits, they are called traits, and the RFC does mention that they shouldn't contain state. So a trait (by definition) should be purely behavioral (methods only). So, based on that, it does indeed seem like a bug to me that they currently support properties. If properties are to be supported, then why don't we rename the trait to a mixin and have some semblance of consistency... Anthony On Fri, Jul 22, 2011 at 12:18 PM, Adam Harvey wrote: > On 22 July 2011 09:12, Alex Howansky wrote: >> >>> That makes sense if it would overwrite the methods as well, but >>> otherwise it seems like it provides inconsistent functionality. >> >> Exactly. At the least, it's inconsistent. If it's a bug, then it seems the >> question becomes: >> >> Is the bug this: >> >> "Properties defined in a trait should be overridden by same-named properties >> defined in a class that use the trait." >> >> Or (as pointed out by Anthony) this: >> >> "You shouldn't be able to define properties in a trait." > > Traits definitely need to be able to support properties, IMO, so I'd > say that the first behaviour just needs to be documented (and > potentially a notice added). Either the trait or the class is going to > have its property overwritten, so we should pick which definition wins > and go from there. > > Adam > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >