Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:51015 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 22136 invoked from network); 12 Dec 2010 14:26:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Dec 2010 14:26:01 -0000 Authentication-Results: pb1.pair.com smtp.mail=jbondc@openmv.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=jbondc@openmv.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain openmv.com from 64.15.152.204 cause and error) X-PHP-List-Original-Sender: jbondc@openmv.com X-Host-Fingerprint: 64.15.152.204 mail.ca.gdesolutions.com Received: from [64.15.152.204] ([64.15.152.204:63526] helo=mail.ca.gdesolutions.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6E/D1-09585-67BD40D4 for ; Sun, 12 Dec 2010 09:26:00 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.ca.gdesolutions.com (Postfix) with ESMTP id 1786C5D18; Sun, 12 Dec 2010 09:25:55 -0500 (EST) X-Virus-Scanned: amavisd-new at gdesolutions.com Received: from mail.ca.gdesolutions.com ([127.0.0.1]) by localhost (mail.ca.gdesolutions.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id p2Nr7upBMIGu; Sun, 12 Dec 2010 09:25:54 -0500 (EST) Received: from djbondc (modemcable083.208-56-74.mc.videotron.ca [74.56.208.83]) by mail.ca.gdesolutions.com (Postfix) with ESMTP id 85B6F5D16; Sun, 12 Dec 2010 09:25:54 -0500 (EST) To: "'Stefan Marr'" Cc: References: In-Reply-To: Date: Sun, 12 Dec 2010 09:25:51 -0500 Message-ID: <002101cb9a08$7b7ebb30$727c3190$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcuZR8u7B0eCDcVTReKnCUUNb7hyFQABhuXQ Content-Language: en-ca Subject: RE: [PHP-DEV] Traits expecting interfaces implicitly leads to expensive runtime checks From: jbondc@openmv.com ("Jonathan Bond-Caron") On Sat Dec 11 10:25 AM, Stefan Marr wrote: > http://wiki.php.net/rfc/horizontalreuse#requiring_composing_class_to_impleme nt_interface > > > Are there any objections to implementing this? > It's not a bad idea, though I haven't found a strong need for it in the way I plan to use traits. It also turns a trait into something more complex 'copy & paste' code with requirements/dependencies. -1 on using 'require' (T_REQUIRE token), an option could be 'within' trait IteratorUser within Iterator { function foo() { $next = $this->next(); ... } } class MyIterator implements Iterator { with IteratorUser; } So the 'with/within' tokens would apply to traits. Overall I feel -1, more use cases around "Trait expresses a requirement for the composing class" would help, it seems like useful theory... not convinced it's worth the trouble.