PHP has evolved into a feature-rich, widely deployed web development solution. With each new
version released, new features appear, while existing features are improved. PHP’s object
support is one such feature that has been improved. Object oriented support first appeared in
PHP3. PHP4 made additional improvements, such as the way constructors are handled. In fact,
the up and coming
Zend Engine 2.0 introduces a new object model, more similar to Java. With PHP’s object
support maturing, many of the reasons developers might not take an object oriented approach
are diminishing.
version released, new features appear, while existing features are improved. PHP’s object
support is one such feature that has been improved. Object oriented support first appeared in
PHP3. PHP4 made additional improvements, such as the way constructors are handled. In fact,
the up and coming
Zend Engine 2.0 introduces a new object model, more similar to Java. With PHP’s object
support maturing, many of the reasons developers might not take an object oriented approach
are diminishing.
This article is the first in a series of articles that will focus on various object-oriented
design topics. In this article we are going to talk about the concepts surrounding abstract
classes, situations where they are useful in design, how we can implement abstract classes in PHP,
and hopefully some helpful examples to demonstrate the concepts covered.
design topics. In this article we are going to talk about the concepts surrounding abstract
classes, situations where they are useful in design, how we can implement abstract classes in PHP,
and hopefully some helpful examples to demonstrate the concepts covered.
Prerequisites
In order to get the most out of this article, you need to have a solid understanding of several
OO concepts, such as: what is an object, defining an object, instantiation, inheritance, and
object composition. For an in depth look at the before mentioned topics, check out some of the other
great articles in the
Application Architecture / Object Oriented section on this site. With that being said, let’s move on
to our discussion of abstract classes and how you can use them in design.
OO concepts, such as: what is an object, defining an object, instantiation, inheritance, and
object composition. For an in depth look at the before mentioned topics, check out some of the other
great articles in the
Application Architecture / Object Oriented section on this site. With that being said, let’s move on
to our discussion of abstract classes and how you can use them in design.