Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50893 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 61508 invoked from network); 7 Dec 2010 12:03:54 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Dec 2010 12:03:54 -0000 Authentication-Results: pb1.pair.com smtp.mail=derick@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=derick@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 82.113.146.227 as permitted sender) X-PHP-List-Original-Sender: derick@php.net X-Host-Fingerprint: 82.113.146.227 xdebug.org Linux 2.6 Received: from [82.113.146.227] ([82.113.146.227:48733] helo=xdebug.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 49/E2-40992-7A22EFC4 for ; Tue, 07 Dec 2010 07:03:52 -0500 Received: from localhost (xdebug.org [127.0.0.1]) by xdebug.org (Postfix) with ESMTPS id 4AB3EDE141; Tue, 7 Dec 2010 12:03:43 +0000 (GMT) Date: Tue, 7 Dec 2010 12:03:43 +0000 (GMT) X-X-Sender: derick@kossu.derickrethans.nl To: Stefan Marr cc: "internals@lists.php.net Development" In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: [PHP-DEV] Traits and Conflicts: Collisions as Warnings or Fatal? From: derick@php.net (Derick Rethans) On Sun, 5 Dec 2010, Stefan Marr wrote: > While preparing some explanations on how to use traits, I stumbled > over an inconsistency in the current implementation. > > Currently collisions, if they are explicit in the code, lead to a > warning and are resolved by explicit exclusion of the two methods that > collide[1]. However, there are other ways to provoke a collision, for > instance by introducing a new alias during composition[2]. > > [1] http://svn.php.net/viewvc/php/php-src/trunk/Zend/tests/traits/error_015.phpt?revision=305512&view=markup > [2] http://svn.php.net/viewvc/php/php-src/trunk/Zend/tests/traits/language010.phpt?revision=305512&view=markup > > > Collisions usually point to implementations that changed unexpectedly, > and the implicit resolution might be problematic since it could hide > the real cause for a bug. > > So, should that warning be changed to a fatal error, or should the > other fatals be warnings, too? IMO they should be fatal because your code is "broken". Derick -- http://derickrethans.nl | http://xdebug.org Like Xdebug? Consider a donation: http://xdebug.org/donate.php twitter: @derickr and @xdebug