Constructors are a special kind of method. They are called 'behind-the-scenes' when an object is created.
That means that we don't have to write the code that calls them as PHP does the work for us.
Cheers PHP π
Branch: https://github.com/GaryClarke/learn-oophp/tree/5-constructors
8 comments