__construct() vs method with same name as class

Dxxz

New Member
I have recently started php and was wondering the differences between __construct() and having a method with the same name as the class? Is there a reason for using it? All I can work out is it overrides the method named Foo or is it down to which you prefer?E.g.\[code\]class Foo { function Foo() { echo 'Foo stated<br>'; } function __construct() { echo 'Construct started<br>'; }}\[/code\]Thanks
 
Top