Skip to content
beeon.academy
backendIntermediate

PHP OOP

43 lessons: classes and encapsulation, readonly, property hooks and asymmetric visibility, static members and late static binding, inheritance, interfaces, traits and composition, the type system, enums and value objects, exceptions, SOLID, design patterns, a DI container, reflection, attributes, lazy objects, serialization, PSR-4 packages, a domain model and events, PHPUnit, refactoring and a billing capstone. Checked against PHP 8.6.

PHP 8.6ComposerPSR-4PHPUnitPHPStanRector
Starting from
55 000 ֏
  • HY · RU
  • Certificate on completion
Start learning
What this course is about

Overview

43 lessons: classes and encapsulation, readonly, property hooks and asymmetric visibility, static members and late static binding, inheritance, interfaces, traits and composition, the type system, enums and value objects, exceptions, SOLID, design patterns, a DI container, reflection, attributes, lazy objects, serialization, PSR-4 packages, a domain model and events, PHPUnit, refactoring and a billing capstone. Checked against PHP 8.6.

Learning outcomes

What you will learn

Design classes that guard their own rules (encapsulation, value objects, enums)
Apply SOLID and design patterns in real PHP code
Understand how DI containers, attributes and ORMs work inside
Build and test a domain model with PHPUnit and PHPStan
What you need to start

Requirements

  • PHP basics: variables, functions, arrays (the PHP and MySQL course or similar experience)
  • Composer and a terminal
  • PHP 8.4 or newer on your computer (for PHPUnit 13)
Interactive course

Lessons

43 lessons · all open, start with any
  1. 1Course overview10 min
  2. 2From procedural code to objects20 min
  3. 3Project setup: Composer, PSR-4, PHPUnit and PHPStan20 min
  4. 4Classes, objects and identity20 min
  5. 5Encapsulation and invariants25 min
  6. 6Constructors and named constructors25 min
  7. 7Readonly properties and immutable objects25 min
  8. 8Property hooks and asymmetric visibility25 min
  9. 9Static members and late static binding20 min
  10. 10Class constants20 min
  11. 11Magic methods20 min
  12. 12Cloning and object copies20 min
  13. 13Inheritance and overriding25 min
  14. 14Abstract classes20 min
  15. 15Interfaces and contracts20 min
  16. 16Traits in depth20 min
  17. 17Polymorphism20 min
  18. 18Composition over inheritance25 min
  19. 19The type system: union, intersection and DNF types, variance25 min
  20. 20Enums25 min
  21. 21Value objects25 min
  22. 22Collections and iterators25 min
  23. 23Designing exceptions20 min
  24. 24Handling absence: null, Null Object and Result20 min
  25. 25SOLID: single responsibility and open/closed25 min
  26. 26SOLID: Liskov substitution and interface segregation25 min
  27. 27SOLID: dependency inversion and injection25 min
  28. 28Creational patterns: factory, builder, singleton25 min
  29. 29Structural patterns: adapter, decorator, facade, proxy25 min
  30. 30Behavioural patterns: strategy, observer, command, pipeline25 min
  31. 31Building a dependency injection container30 min
  32. 32Reflection25 min
  33. 33Attributes25 min
  34. 34Lazy objects20 min
  35. 35Serialization and data transfer objects25 min
  36. 36Autoloading and package design20 min
  37. 37Domain modelling: entities, aggregates and repositories30 min
  38. 38Domain events and event dispatching25 min
  39. 39Testing object-oriented code30 min
  40. 40Refactoring procedural code to objects30 min
  41. 41PHP OOP interview questions20 min
  42. 42Capstone: an object-oriented billing module60 min
  43. 43Next steps15 min
What students say

Student reviews

Common questions

FAQ

PHP 8.6. Features from 8.4–8.6 (property hooks, lazy objects, the pipe operator, partial application) are marked with their version in the lessons.
Starting from
55 000 ֏
Start learning