Are you looking to dive into the world of Object-Oriented
Programming in PHP but don't know where to start? I have for you a new
concise guide to OOP that will introduce you to all the concepts like
class
, extends
, private
, etc.
In this guide, you will learn about:
- class and object
- namespaces
- inheritance versus composition
- visibility
- the
final
keyword - static properties, methods, and constants
- interfaces or abstract classes
- type checking
- Fluent Interfaces
- traits
- and how exceptions work
This guide is not intended to make you a master of writing clean code or to provide exhaustive information. Its goal is to quickly familiarize you with the basic concepts of OOP in current PHP and to give you factually correct information. Thus, it provides a solid foundation on which you can further build, such as applications in Nette.
As further reading, I recommend the detailed guide to proper code design. It is beneficial even for those who are proficient in PHP and object-oriented programming.
Leave a comment