O'Reilly logo

PHP Objects, Patterns, and Practice, Second Edition by Matt Zandstra

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 4Advanced Features

We have already seen how class type hinting and access control give you more control over a class's interface. In this chapter, we will delve deeper into PHP's enhanced object-oriented support.

This chapter will cover

  • Static methods and properties: Accessing data and functionality through classes rather than objects
  • Abstract classes and interfaces: Separating design from implementation
  • Error handling: Introducing exceptions
  • Final classes and methods: Limiting inheritance
  • Interceptor methods: Automating delegation
  • Destructor methods: Cleaning up after your objects
  • Cloning objects: Making object copies
  • Resolving objects to strings: Creating a summary method

Static Methods and Properties

All the examples in the previous ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required