© 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_8

8. Inheritance

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

It’s all very nice, but I didn’t get it!

ALF (TV series)

This chapter is devoted to such a critical OOP mechanism as inheritance. Along with encapsulation and polymorphism, inheritance is one of the three pillars on which the knowledge of OOP rests. Next, you learn how inheritance is implemented in PHP.

Creating a Child Class

So, let’s say that you have a class that you would like to modify (add some new properties and methods to it). In principle, you ...

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.