News Feed
Sections




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

WebReference.com:
Class Inheritance with PHP
September 12, 2007 @ 09:38:00

WebReference.com has a new tutorial posted today (from Kris Hadlock) concerning the class inheritance functionlaity that's a part of the object oriented structure in PHP:

There are many benefits of inheritance with PHP, the most common is simplifying and reducing instances of redundant code. Class inheritance may sound complicated, but think of it this way. Consider a tree. A tree is made up of many parts, such as the roots that reside in the ground, the trunk, bark, branches, leaves, etc. Essentially inheritance is a connection between a child and its parent. [...] This article assumes a basic understanding of OOP with PHP.

They show how to create the parent object as a base and how to inherit it into a child class - using the extend keyword in the class definition. They give an example of their sample code in action so you can see how the inheritance is handled.

1 comment voice your opinion now!
class object oriented inheritance parent extends tutorial class object oriented inheritance parent extends tutorial


blog comments powered by Disqus

Similar Posts

SitePoint PHP Blog: How to Implement User Log-in with PayPal

ServerGrove Blog: Deploying Symfony2 Projects on Shared Hosting with Capifony

DevShed: Using Inheritance, Polymorphism and Serialization with PHP Classes

Fabien Potencier's Blog: Create your own framework... on top of the Symfony2 Components (part 7)

SitePoint PHP Blog: Push Notifications with Prowl


Community Events





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


package voicesoftheelephpant community library interview series version podcast framework install introduction laravel composer release security language update opinion tool symfony

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