PHP Objects, Patterns, and Practice

PHP Objects, Patterns, and Practice

4.5 6
by Matt Zandstra

View All Available Formats & Editions

PHP Objects Patterns and Practice, Fourth Edition is revised and updated throughout.
The book begins by covering PHP's object-oriented features. It introduces key topics including class declaration, inheritance, reflection and much more. These provide the fundamentals of the PHP's support for objects. It also introduces some principles of

…  See more details below


PHP Objects Patterns and Practice, Fourth Edition is revised and updated throughout.
The book begins by covering PHP's object-oriented features. It introduces key topics including class declaration, inheritance, reflection and much more. These provide the fundamentals of the PHP's support for objects. It also introduces some principles of design.
This edition introduces new object relevant features such as traits, reflection extension additions, callable type hinting, improvements to exception handling, and many smaller language enhancements.

The next section is devoted to design patterns. These describe common problems and their solutions. The section describes the design principles that make patterns powerful. It covers many of the classic design patterns and includes chapters on enterprise and database patterns.

The last segment of the book covers the tools and practices that can help turn great code into a successful project. The section shows how to manage multiple developers and releases with git, how to build and install using Phing and PEAR. It also explores strategies for automated testing and build.

In addition to discussing the latest developments in build, test, and continuous integration, this section keeps pace with best practice in version control by focusing on Git, increasingly the developer's system of choice.

Taken together these three elements: object fundamentals, design principles, and best practice will help the reader develop elegant and rock solid systems.

PHP Objects and Patterns:

  • Describes and demonstrates PHP's built-in object-oriented features
  • Breaks down the principles of object-oriented design, explaining key design patterns using practical examples.
  • Discusses the tools and practices necessary for developing, testing and deploying exemplary applications.

What you’ll learn

You will:
  • Learn to work with object fundamentals: writing classes and methods, instantiating objects, creating powerful class hierarchies using inheritance
  • Master advanced object-oriented features, including static methods and properties, managing error conditions with exceptions, and creating abstract classes and interfaces.
  • Understand and use design principles to deploy objects and classes effectively in your projects.
  • Learn about design patterns, their purpose, structure and the underlying principles that govern them.
  • Discover a set of powerful patterns that you can deploy in your own projects
  • Learn about the tools and practices that can guarantee a successful project including unit testing; version control, build, installation and package management; and continuous integration.

Who this book is for

This book is suitable for anyone with at least a basic knowledge of PHP who wants to use its object-oriented features in their projects.

Those who already know their interfaces from their abstracts may well still find it hard to use these features in their projects. They will benefit from the book's emphasis on design. They will learn how to choose and combine the participants of a system; how to read design patterns and how to use them in their code.

Finally this book is for PHP coders who want to learn about the practices and tools (version control, testing, continuous integration, etc) that can make projects safe, elegant and stable.

Table of Contents

  1. PHP: Design and Management
  2. PHP and Objects
  3. Object Basics
  4. Advanced Features
  5. Object Tools
  6. Objects and Design
  7. What Are Design Patterns? Why Use Them?
  8. Some Pattern Principles
  9. Generating Objects
  10. Patterns for Flexible Object Programming
  11. Performing and Representing Tasks
  12. Enterprise Patterns
  13. Database Patterns
  14. Good (and Bad) Practice
  15. An Introduction to PEAR and Pyrus
  16. Generating Documentation with phpDocumentor
  17. Version Control
  18. Testing with PHPUnit
  19. Automated Build with Phing
  20. Continuous Integration
  21. Objects, Patterns, and Practice
  22. App A: Bibliography
  23. App B: A Simple Parser

Read More

Editorial Reviews

PHP increasingly offers developers strong object-oriented features. Using these features, PHP developers are leveraging powerful Java/C++-style design patterns, and creating utilities to streamline the entire development process. Matt Zandstra's PHP Objects, Patterns, and Practice illuminates all of this, helping you leverage PHP in complex, mission-critical environments.

Zandstra goes beyond teaching PHP 5's object features to help you think about objects more effectively, and make better design decisions. (He also previews PHP 6's long-awaited namespaces, and shows how to achieve many of the same benefits with PHP 5.)

Next, he migrates the programming industry's key design patterns to PHP: singleton, factory method, decorator, façade, observer, and many more. Finally, in an indispensable "practice" section, he turns to the challenges of building large-scale PHP software -- and the excellent tools now available to help teams document, manage, test, build, and deploy their code. Bill Camarda, from the February 2008 Read Only

Product Details

Publication date:
Edition description:
2nd ed.
Product dimensions:
7.50(w) x 9.00(h) x 9.25(d)

Meet the Author

Matt Zandstra has worked as a Web programmer, consultant and writer for a decade. He has been an object evangelist for most of that time. Matt is the author of SAMS Teach Yourself PHP in 24 Hours (three editions), and contributed to DHTML Unleashed. He has written articles for Linux Magazine and Matt works primarily with PHP, Perl and Java, building online applications. He is an engineer at Yahoo! in London.

Matt lives in Brighton with his wife Louise, and two children, Holly and Jake. Because it has been so long since he has had any spare time he only distantly recollects that he runs regularly to offset the effects of his liking for pubs and cafes, and for sitting around reading and writing fiction. Learn more on Matt's website,

Customer Reviews

Average Review:

Write a Review

and post it to your social network


Most Helpful Customer Reviews

See all customer reviews >

PHP Objects, Patterns, and Practice 4.5 out of 5 based on 0 ratings. 6 reviews.
Guest More than 1 year ago
I've personally read about 100+ IT-related books, ranging from Certification Crams, Networking, Programming, and even computer repair. I¿ve developed with PHP for almost 7 years now, having over 10 years of development language experience overall with other languages. What I'm about to say may surprise some, some may even find it hard to believe, and even more will absolutely disregard it as truth. On the flip side, what I am about to say may intrigue you, have you yearning to learn more, or even have you ready to go buy the book at this very moment. Either way that's your opinion, your thoughts and ultimately your decision. I'm simply telling it how it is, while being as truthful as I possibly can be. PHP Objects, Patterns, and Practice is by far, the most thought out, well planned and pleasant books I've read on any subject, period. Most technical books leave you feeling like the author was some sort of robot from Mars, sent to Earth intent upon teaching humans how to write code. This book takes a totally different approach, an approach that I could only dream of taking to explain advanced concepts that Mr. Zandstra explains. The book begins with giving the reader a 'blast to the past' look at how PHP started out, how it evolved and what we should be expecting to see in the future. It explains how OOP came into being, how it became much more than the author's could ever dream, and how it eventually became the selling point for PHP. After giving you a brief history lesson, it finally starts into the actual technical sections. Once again, they follow the idea of showing the reader where PHP went wrong, and then finally how they made up for it by doing it the way it was supposed to have been done. The first three chapters explain the above in extreme and perfect detail. The following chapters begin your development cycle by first bringing the reader up to speed on OOP basics followed by advanced topics that help mold your mind around working in PHP's brand new OOP environment. The chapters after basically keep building on top of that foundation, zeroing in on trouble areas followed by intelligent solutions to each problem. Every single page I read, I learned something new. Every single exercise, I said to myself, wow...I can't believe I've made it this far without knowing this. What makes this book so appealing to me is that it's not meant for the newbie as almost every book you find at Barnes and Nobel will be. Instead, it¿s directed at the seasonal developer, the developer who has already been coding in PHP for 4+ years, developed long enough to know what PHP can and cannot do. It¿s also for the developer who has longed for a book that gives us incentive for moving to 5 and away from our trusty stable PHP 4 release. Matt uses such an impressive means of explaining how things work, that I probably have learned more in this 470 page book 'yes, I even read the Appendixes, which is an honest-to-God first for me' than I've learned in any 1000+ page book. Every time I met a new chapter, I found myself ready to open the trusty laptop and try it out instead of skipping about 10 chapters to finally get to a place that actually covered something meaningful. Matt Zandstra, my hat is off to you. This book was everything I have been looking for in a PHP book.
Anonymous More than 1 year ago
If your looking for the key to using php in an object oriented design then this book is for you. It explains patterns and how to leverage the language. Patterns will help with any language you program in so this is a great reference in any library. Great for omeone who knows PHP but wants to learn ways to develope full scale applications that are easily maintained and modular.
Anonymous More than 1 year ago
Anonymous More than 1 year ago
Anonymous More than 1 year ago
Anonymous More than 1 year ago