News Feed
Sections




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

PHPBuilder.com:
Class Inheritance with PHP
February 18, 2008 @ 07:58:00

On PHPBuilder.com today, there's a new tutorial that takes a beginning look at PHP5's class inheritance model.

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.

They choose to go with a "car" illustration instead and show how a child of the Product class (Car) can access the private properties of the parent. They also include an example of it in action with a bit of HTML output.

0 comments voice your opinion now!
inheritance class php5 object private protected public tutorial


blog comments powered by Disqus

Similar Posts

Padraic Brady's Blog: PHP Mutation Testing With MutateMe

Paul Jones' Blog: Solar 1.0.0 alpha1 Released

SitePoint PHP Blog: Using Guzzle with Twitter via Oauth

PHP-GTK Community Site: Code completion for PHP-GTK in Zend Studio 5.5

DevShed: Drawing Basic Rectangles in PDF Documents with PHP 5


Community Events

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


podcast extension release opinion language series laravel5 api interview library unittest example install xdebug community introduction voicesoftheelephpant framework php7 laravel

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