News Feed
Sections




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

Brandon Savage's Blog:
Where Multiple Inheritance Will Kill You
July 17, 2009 @ 11:19:02

In this new post to his blog Brandon Savage takes a look at multiple inheritance in PHP applications - specifically where it could "kill you" if you're not careful.

This is a fantastic way to further encapsulate and abstract your code because it means you can define some base functionality and then later on extend that class to add new functionality and even override existing functionality to make the class specific. But this concept is a double-edged sword in PHP (and all other languages).

The problem lies in methods in classes that could be overriding parents and the sort of results that instance of might return in a multiple inheritance environment. He includes code snippets both illustrating the problem and showing a suggestion for how it could be avoided.

2 comments voice your opinion now!
problem instanceof inheritance multiple


blog comments powered by Disqus

Similar Posts

Reign's SourceRally Blog: The PHP coder's top 10 mistakes and problems

Christopher Kunz's Blog: Warning about the article "SQL Injection" in current "PHP Magazin"

Elated.com: Object-Oriented PHP: Working with Inheritance

Joshua Thijssen: @MultiParamConverter for Symfony2

Jani Hartikainen's Blog: The problems faced by a common model interface in frameworks


Community Events





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


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

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