Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:35589 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 42063 invoked by uid 1010); 19 Feb 2008 12:09:29 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 42045 invoked from network); 19 Feb 2008 12:09:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Feb 2008 12:09:29 -0000 Authentication-Results: pb1.pair.com header.from=stefan.marr.de@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=stefan.marr.de@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 64.233.178.245 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: stefan.marr.de@gmail.com X-Host-Fingerprint: 64.233.178.245 hs-out-0708.google.com Linux 2.4/2.6 Received: from [64.233.178.245] ([64.233.178.245:25147] helo=hs-out-0708.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D3/DB-55225-7F6CAB74 for ; Tue, 19 Feb 2008 07:09:28 -0500 Received: by hs-out-0708.google.com with SMTP id l65so1763537hsc.7 for ; Tue, 19 Feb 2008 04:09:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=nR1vuH6dqIo6h3X3z6kD0TWpkc+j9hDEr6J6f0Zf8jM=; b=wrxmSvWM33T2s++zUV+3lylbzcrfO7fI6NDt0+VDHW2b2Q4zrnfvt2ffZy0PxkcYxXXXcmElK6F8AHlOLzGGFOTPSRYOBMd8wlbmeJMFHljxZnx2elXgJPpIr5CscCc/BWFkBkuRAmDfc6vmKVf2Qwm4OZPrCTe9RsjqJRhKTyA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=wn1Z+hyluz8uy7eui5+BlD4bCVzs9QpLdoJQa+nqBwOvy1zN5bmAAmLwCdN9AXrNLN741kISg7Aiy5feyKcZfpICpCLhcj+b+0GFKkSRpmVQ5d2u4i9XMaw/+i1zz2QcIbXbmNzlcy5iP0MP+pwn+rX/LODIaGXM4CYYGSJjI8Q= Received: by 10.142.178.13 with SMTP id a13mr5224598wff.129.1203422964453; Tue, 19 Feb 2008 04:09:24 -0800 (PST) Received: by 10.142.141.2 with HTTP; Tue, 19 Feb 2008 04:09:24 -0800 (PST) Message-ID: <1e12984d0802190409g4fc04c88hd0ddf0f920706a66@mail.gmail.com> Date: Tue, 19 Feb 2008 13:09:24 +0100 Sender: stefan.marr.de@gmail.com To: "Mark van der Velden" Cc: "PHP internals" In-Reply-To: <47BAB2A5.8050008@dynom.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <47BAB2A5.8050008@dynom.nl> X-Google-Sender-Auth: 41d91091a4cde15d Subject: Re: [PHP-DEV] RFC: Traits for PHP From: php@stefan-marr.de ("Stefan Marr") 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