A constructor allows you to initialize an object's properties upon creation of the object.
If you create a __construct() function, PHP will automatically call this function when you create an object from a class.
It saves us from calling the set_name() method which reduces the amount of code.
Edit the code below and click Run to see the result live.