© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2024
A. VasilevPHP by Examplehttps://doi.org/10.1007/979-8-8688-0258-4_9

9. Advanced OOP Mechanisms

Alex Vasilev1  
(1)
Department of Software Systems and Technologies, Taras Shevchenko National University of Kyiv, Kyiv, Ukraine
 

I don’t know whether to laugh or cry.

ALF (TV series)

This chapter explores the crucial mechanisms for implementing the OOP concept in PHP. In particular, you get familiar with interfaces, abstract classes, and traits. You also get some notion about a namespace and anonymous classes. Let’s start with abstract classes.

Abstract Classes

When you create a class, you may not describe some methods but only declare them. In other words, you can specify ...

Get PHP by Example: A Practical Guide to Creating Web Applications with PHP 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.