Re: RFC: Traits for PHP

From: Date: Tue, 19 Feb 2008 12:09:24 +0000
Subject: Re: RFC: Traits for PHP
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-35589@lists.php.net to get a copy of this message
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

« previous php.internals (#35589) next »