Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:45817 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8610 invoked from network); 14 Oct 2009 20:44:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Oct 2009 20:44:07 -0000 Authentication-Results: pb1.pair.com smtp.mail=tom@punkave.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=tom@punkave.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain punkave.com from 209.85.217.226 cause and error) X-PHP-List-Original-Sender: tom@punkave.com X-Host-Fingerprint: 209.85.217.226 mail-gx0-f226.google.com Received: from [209.85.217.226] ([209.85.217.226:42416] helo=mail-gx0-f226.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 24/F8-58792-51836DA4 for ; Wed, 14 Oct 2009 16:44:06 -0400 Received: by gxk26 with SMTP id 26so208714gxk.11 for ; Wed, 14 Oct 2009 13:44:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.101.144.1 with SMTP id w1mr7859581ann.81.1255553042973; Wed, 14 Oct 2009 13:44:02 -0700 (PDT) In-Reply-To: <3530BC53-F4D6-48EC-BBEB-54E79AD497C3@pooteeweet.org> References: <002b01c92d67$ae92fdc0$0bb8f940$@de> <9D1CD88B-3A75-453C-9515-5F31E60F90AC@pooteeweet.org> <90CF2907-8C30-4EB0-9AC5-AD00EFC14023@stefan-marr.de> <4AD62E77.9010802@zend.com> <3530BC53-F4D6-48EC-BBEB-54E79AD497C3@pooteeweet.org> Date: Wed, 14 Oct 2009 16:44:02 -0400 Message-ID: To: Lukas Kahwe Smith Cc: Stanislav Malyshev , Stefan Marr , internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] Request for Comments: Horizontal Reuse for PHP From: tom@punkave.com (Tom Boutell) I'm very concerned about the practical consequences of introducing traits without state. Lacking support for properties (state) in traits, programmers will immediately start hacking properties in anyway. I see two approaches: A. They could do this using static hashes in global variables or a separate class. The result is a garbage collection failure as these references to $this will never go away. Designed-in GC failures are unacceptable post PHP 5.3. B. PHP allows you to define properties at runtime. That is, you can write: $this->title = 'my title'; Without declaring var $title; at the class level. But PHP 6 seems to be moving toward more strictness, not less, and this style encourages the use of undeclared variables with the resulting potential for missed bugs. * * * Also, the 'instead' keyword is baffling - it could mean replace A with B or replace B with A depending on how you place your mental comma - I much prefer the assignment syntax alternative, or 'insteadof' which is unambiguous. On Wed, Oct 14, 2009 at 4:07 PM, Lukas Kahwe Smith wrote: > > On 14.10.2009, at 22:03, Stanislav Malyshev wrote: > >> Hi! >> >>>> So lets warm this up again. >>>> HEAD is for development .. so lets get this into HEAD so that it will be >>>> part of the next bigger PHP release for sure! >>> >>> Well, the code is sitting here >>> http://github.com/gron/php-src/tree/PHP_6-traits >>> and waits to be merged. :) >> >> I thought before merging code it would be useful to have some discussion >> on if the code is actually doing what we want. If it's based on >> http://wiki.php.net/rfc/horizontalreuse then for example I can see some >> potential issues for bytecode caching related to renaming and changing >> visibility. >> Also, it is not clear that we want grafts there at all, some aspects of >> them seem to get too hairy, esp. $this issue or statics. >> > > i think Stefan is fully aware of that probably there will be a discussion > first .. > but i think we all agree that this feature is very high on the list of what > people want and therefore i wanted to get this discussion going, so that > after its concluded traits can be commited to HEAD. > > regards, > Lukas Kahwe Smith > mls@pooteeweet.org > > > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Tom Boutell P'unk Avenue 215 755 1330 punkave.com window.punkave.com