ASPit - Totally ASP JSit - Totally JavaScript
Search PHPit

Use this textbox to search for articles on PHPit. Seperate keywords with a space.


Book Review: PHP 5 Objects, Patterns and Practice

(Page 1 out of 2)


Welcome to the second review on PHPit. This time I take a look at "PHP 5 Objects, Patterns and Practice", written by Matt Zandstra and published by Apress. I've been trying to get into OOP and Design patterns myself lately, so this book comes at the right time. Read on to learn more about this book.


The publisher of "PHP 5 Objects, Patterns and Practice" sent me a free copy for reviewing purposes.

Technical Details

Title: PHP 5 Objects, Patterns and Practice
Publisher: Apress
Author: Matt Zandstra
Length: 438 pages (18 chapters + two appendixes + index)
ISBN: 1590593804

The Review

This book has definitely been an eye opener for me, and I've learnt plenty of new stuff. Usually I tend to quickly leaf through a PHP book, because most books tend to cover the basic stuff, but this one really covered new area for me.

It's often said that PHP 5 offers hardly anything new, but after reading this book you'll quickly reconsider. It explores every new feature of PHP 5, and it immediately shows you how to apply this new functionality in a practical way.

The book is divided into six parts, and 18 chapters. The first part is only one chapter, and is really more of an introduction to the book. The author explains the problem with PHP, and gives an overview of the things that will be covered in the book. Not really a noteworthy chapter, but it does explain the necessity for Design Patterns and OOP in PHP.

Part two, which consists of chapters two to six, runs through all the key concepts of OOP in PHP. The first chapter of this part, chapter two, is a really short one (three pages) and gives you a brief history of OOP in PHP. Chapter three will get you started with object basics. It covers most of the OOP basics, like declaring classes, using constructor methods, inheritance and a few more topics. Most of the stuff covered in this chapter was already familiar to me, and it will probably be to you as well. It's really basic OOP information, although a few new PHP 5 features are explained (such as visibility modifiers; public, private, protected, etc).

Chapter four introduces some of the new advanced functionality of PHP 5's OOP features and the author covers concepts like abstract classes, interfaces, and exceptions. One thing that I find really great about this book is that almost everything is explained with examples (and many times understandable and useful examples!). It can be hard to understand certain concepts, but a good example really nails it.

In chapter five the author explains some concepts which can be used to programmatically get information about classes. A few regular functions are explained (like the get_class() function), but the biggest part of this chapter is spent on discussing the Reflection API, which is something new in PHP 5. Although not everything is explained, the most important features of the Reflection API are shown, with examples to match of course.

Chapter six is the first chapter that moves into class design, and here's where it starts to get interesting. First the concept of 'class design' and how OOP differs from procedural code is discussed, and things like class scope, polymorphism, composition, aggregation are explained. This is a key chapter, and it's likely you won't understand all of it immediately, although the author does his best to explain it all.

Next: Part Two & Final Verdict »

3 Responses to “Book Review: PHP 5 Objects, Patterns and Practice”

  1. Matthijs Says:

    Indeed! I read slower then you but being half way through I can affirm what you say about the book. This is one of those books which explains everything well and in the process gets you excited for the topic. Excellent.

  2. Says: PHP 5 Objects, Patterns and Practice

  3. Chris Mospaw Says:

    I have owned this bok for a while, and it is very good. In fact, I had to reference it this morning!

    The writing is clear and concise. The examples are appopriate and (with the understanding that they’re ncessarily simple) real world. Like the reviewer said, it’s not for beginners and assumes the reader possesses a certain level of knowledge.

    If you’ve been programming PHP for a little while and want to move “to the next level” this chould be required reading.

Leave a Reply

About the author
Dennis Pallett is the main contributor to PHPit. He owns several websites, including ASPit and Chill2Music. He is currently still studying.
Article Index
  1. Part One
  2. Part Two & Final Verdict
Bookmark Article
Download Article
Download this article as a PDF file