Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:35655 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 19461 invoked by uid 1010); 20 Feb 2008 20:09:42 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 19446 invoked from network); 20 Feb 2008 20:09:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Feb 2008 20:09:42 -0000 Authentication-Results: pb1.pair.com smtp.mail=helly@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=helly@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 85.214.94.56 as permitted sender) X-PHP-List-Original-Sender: helly@php.net X-Host-Fingerprint: 85.214.94.56 aixcept.net Linux 2.6 Received: from [85.214.94.56] ([85.214.94.56:33890] helo=h1149922.serverkompetenz.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 33/C2-30965-4098CB74 for ; Wed, 20 Feb 2008 15:09:41 -0500 Received: from dhcp-172-28-202-237.zrh.corp.google.com (unknown [193.142.125.1]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by h1149922.serverkompetenz.net (Postfix) with ESMTP id 43EE91B365D; Wed, 20 Feb 2008 21:09:38 +0100 (CET) Date: Wed, 20 Feb 2008 21:09:40 +0100 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <194023457.20080220210940@marcus-boerger.de> To: Stanislav Malyshev CC: php@stefan-marr.de, internals@lists.php.net In-Reply-To: <47BB5EFE.4080704@zend.com> References: <001c01c87264$3c01b4e0$b4051ea0$@de> <1203461114.24580.45.camel@localhost> <47BB5EFE.4080704@zend.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] RFC: Traits for PHP From: helly@php.net (Marcus Boerger) Hello Stanislav, if we go the route of allowing that, then we have to do some protocl checks. Meaning if a renamed/aliased method will become an implementation of an abstract method then of course it has to be compatible. The beigger problem I assume you have in mind as well is that replace might be implemented in a way that it uses both delete and add. If now add gets dropped or renamed then there is a problem, called missing function. We could avoid that easily if we have a compiler that allowed us to check which functions are being called. Becasue then we could easily prevent a used function from getting renamed. But all I just said does not really sound like the PHP approach. It is something I would do in my own language. In PHP we always allowed all kinds of nasty. We even hesitate to increase the severity of any E_STRICT. Not even if it would be better for opcode caches. We not even get rid of the insanest stuff... So where do we want to go today with this? marcus Tuesday, February 19, 2008, 11:58:06 PM, you wrote: >> most important issue to me how to handle interface implementations in >> cases where methods from the interface implementing trait are renamed in >> the trait consumer class. > Renaming poses problem not only with interfaces. Imagine trait having > these methods: > function add($key, $value) { ... } > function delete($key) { ... } > function replace($key, $value) { $this->delete($key); $this->add($key, > $value); } > What happens if add() is renamed or replaced with function from other > trait/interface or dropped? > -- > Stanislav Malyshev, Zend Software Architect > stas@zend.com http://www.zend.com/ > (408)253-8829 MSN: stas@zend.com Best regards, Marcus