© Matt Zandstra 2021
M. ZandstraPHP 8 Objects, Patterns, and Practicehttps://doi.org/10.1007/978-1-4842-6791-2_4

4. Advanced Features

Matt Zandstra1  
(1)
Brighton, UK
 

You have already seen how class type hinting and access control give you more control over a class’s interface. In this chapter, I will delve deeper into PHP’s object-oriented features.

This chapter will cover several subjects:
  • Static methods and properties: Accessing data and functionality through classes rather than objects

  • Abstract classes and interfaces: Separating design from implementation

  • Traits: Sharing implementation between class hierarchies

  • Error handling: Introducing exceptions

  • Final classes and methods: Limiting inheritance

  • Interceptor methods: Automating delegation

  • Destructor ...

Get PHP 8 Objects, Patterns, and Practice: Mastering OO Enhancements, Design Patterns, and Essential Development Tools now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.