Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50849 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 73608 invoked from network); 5 Dec 2010 14:53:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Dec 2010 14:53:32 -0000 Authentication-Results: pb1.pair.com smtp.mail=kontakt@beberlei.de; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=kontakt@beberlei.de; sender-id=unknown Received-SPF: error (pb1.pair.com: domain beberlei.de from 178.77.98.152 cause and error) X-PHP-List-Original-Sender: kontakt@beberlei.de X-Host-Fingerprint: 178.77.98.152 lvps178-77-98-152.dedicated.hosteurope.de Linux 2.6 Received: from [178.77.98.152] ([178.77.98.152:34423] helo=beberlei.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 54/07-19822-A67ABFC4 for ; Sun, 05 Dec 2010 09:53:31 -0500 Received: from benny-pc (koln-4d0b19f5.pool.mediaWays.net [77.11.25.245]) by beberlei.de (Postfix) with ESMTPSA id 303576E09017 for ; Sun, 5 Dec 2010 15:53:24 +0100 (CET) Date: Sun, 5 Dec 2010 15:53:13 +0100 To: internals@lists.php.net Message-ID: <20101205155313.421aa981@benny-pc> In-Reply-To: References: X-Mailer: Claws Mail 3.7.6 (GTK+ 2.22.0; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Traits and Conflicts: Collisions as Warnings or Fatal? From: kontakt@beberlei.de (Benjamin Eberlei) I wondered before why this only triggers a warning. A fatal error sounds good at that point in my opinion. It is comparable to interfaces/Abstract classes being implemented wrong and this also leads to a fatal error. Additionally there is no way this "just" happens to your code. You have to make changes to a trait explicitly to trigger this problem, so this is only happening in development. greetings, Benjamin On Sun, 5 Dec 2010 15:03:55 +0100 Stefan Marr wrote: > Hi: > > 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? > > Best regards > Stefan > > -- > Stefan Marr > Software Languages Lab > Vrije Universiteit Brussel > Pleinlaan 2 / B-1050 Brussels / Belgium > http://soft.vub.ac.be/~smarr > Phone: +32 2 629 2974 > Fax: +32 2 629 3525 > > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >