Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:35596 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 14368 invoked by uid 1010); 19 Feb 2008 14:34:13 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 14345 invoked from network); 19 Feb 2008 14:34:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Feb 2008 14:34:13 -0000 Authentication-Results: pb1.pair.com header.from=helly@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=helly@php.net; spf=unknown; 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:41746] helo=h1149922.serverkompetenz.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BE/C6-55225-2E8EAB74 for ; Tue, 19 Feb 2008 09:34:11 -0500 Received: from MBOERGER-ZRH (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 C7EBA1B367D; Tue, 19 Feb 2008 15:34:06 +0100 (CET) Date: Tue, 19 Feb 2008 15:34:08 +0100 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <1028403632.20080219153408@marcus-boerger.de> To: "Stefan Marr" CC: "Mark van der Velden" , "PHP internals" In-Reply-To: <1e12984d0802190409g4fc04c88hd0ddf0f920706a66@mail.gmail.com> References: <47BAB2A5.8050008@dynom.nl> <1e12984d0802190409g4fc04c88hd0ddf0f920706a66@mail.gmail.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 Stefan, a userland copy'n'paste does not allow to reuse already compiled opcodes. Traits do at least conceptionally. marcus Tuesday, February 19, 2008, 1:09:24 PM, you wrote: > Hi Mark, >> If it doesn't affect performance *MUCH* then I'm all for it ! It can >> bring better structure for complex designs. Also by reusing, I'm >> assuming less memory will be needed for the code base which is beneficial. > the current implementation does not save any memory compared to a > user-level copy'n'past solution. But there might be the opportunity to > optimize the op_array handling. > The performance impact is almost the same for a trait usage as for > inheritance or interface definitions. The only costly operation is > copying the method body from the trait to the class where it is used. > But this should be much cheaper than parsing the method for each > single class, what would be necessary if one would use a good old > copy'n'past approach. > Kind Regards > Stefan Best regards, Marcus