Is there any advantage to using __construct() instead of the class\'s name for a constructor in PHP?
__construct()
Example (__construct):
__construct
The best advantage of using __contruct() instead of ClassName() is when extending classes. It is much easier to call parent::__construct() instead of parent::ClassName(), as it is reusable among classes and the parent can be changed easily.
__contruct()
ClassName()
parent::__construct()
parent::ClassName()