Quiz of the Day: 08/12/2016

Read Time:57 Second



B) Constructor

All objects can have a special built-in method called a ‘constructor’. Constructors allow you to initialise your object’s properties (translation: give your properties values,) when you instantiate (create) an object.

Note: If you create a __construct() function (it is your choice,) PHP will automatically call the __construct() method/function when you create an object from your class.

The ‘construct’ method starts with two underscores (__) and the word ‘construct’.

If you want to explore more, visit our PHP edu & tutorials section!

Below are some examples:

PHP Super Basics & Possible Code Clash!

Temple – PHP Language engine


You might also like this video