News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SimasToleikis' Blog:
New to PHP 5.4 Traits
November 22, 2010 @ 09:11:09

Simas Toleikis has a new post to his blog looking at a feature that'll be included in PHP 5.4 - something developers have been wanting for a long time - traits.

As a long-time internals.php mailing list reader I am going to tell you a small secret - the first alpha release for PHP 5.4 should be just around the corner. This release is packed with some welcome new language features, usual bug fixes followed by some performance and memory management improvements. One of the noteworthy language additions are Traits - a brand new horizontal code reuse mechanism.

He explains traits as a better way to do the "kind-of" inheritance that PHP does now with parent and child classes, making it easier to reuse functionality from classes even though they don't share the same parent. With the "use" keyword (not to be confused with the "use" keyword in namespaces) you can include common functionality into class methods and even accommodate for naming conflicts and requirements.

0 comments voice your opinion now!
traits new feature internals mixins inheritance


blog comments powered by Disqus

Similar Posts

Knut Urdalen's Blog: Try Yii Framework for your next large-scale web 2.0 application...

DZone.com: What new feature in PHP 5.4 is the most important to you?

HHVM.com: Wow HHVM is fast...too bad it doesn’t run my code

The Bakery Blog: A gift for all to enjoy

Zend Developer Zone: Creating Web Page Templates with PHP and Twig (part 2)


Community Events





Don't see your event here?
Let us know!


list community laravel interview tips zendserver development threedevsandamaybe podcast conference bugfix introduction code api release language symfony series framework deployment

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework