PHP 8: Objects Patterns and Practice

After a year of hard work, I’m overwhelmingly pleased and relieved to announce that the first volume of the new PHP 8: Objects Patterns and Practice is out and available for purchase!

What’s that? First volume? That’s the reason that things have been a quiet on this site for the last year. For each of the previous six editions of the book, its page count has grown and grown. The first edition was a relatively slim affair. The sixth was a back breaker – big enough to stun a horse. With a bumper seventh edition in prospect, Apress asked me if I would consider breaking the book into two separate volumes: one focussing on language and design, the second concerned with development tools and practices.

Of course, having agreed to this, I found that what might have been a relatively speedy revision process became a much more significant undertaking. A second volume offered much more room for new content, and that was a opportunity that was hard to pass up.

What’s Changed in Volume One

The first volume covers PHP’s object-oriented features and delves into design principles and patterns. As always, it has been reviewed and revised to take account of changes and new opportunities.

In addition to updates and revisions it includes a whole range of features introduced since the previous edition, including read only classes, enumerations, typed class constants, and various additions to argument and return types.

To reflect changes in accepted best practice it largely deprecates the Service Locator (also known as Registry) pattern. Instead, it makes more use of the Inversion of Control pattern, and deploys a custom dependency injection container.

A Teaser for Volume Two

The second volume is complete in first draft and awaiting the attentions of tech reviewer Paul Tregoing.

Note I have also been acting as tech reviewer on Paul’s forthcoming Apress book, which I look forward to posting about here. Better yet, I’ll get him to post about it too!

The book will include all the Practice elements of the sixth edition including chapters on standards, testing, Vagrant, version control and continuous integration. This edition will reintroduce a chapter on inline documentation as well as entirely new coverage of Docker, Ansible, static analysis tools, PHP on the command line, and GitHub Actions.

Watch this space!

A Free Book?

Apress have sent me a box of POPP goodness. Since stunning horses is cruel, I’ll probably be looking for ways to give them away in the coming week or two. Again, watch this space.


Yes! Please sign me up to this newsletter


Photo by Patrick Tomasso on Unsplash