According to the PHP5 manual, __construct()
was introduced in PHP5 as a replacement for SameAsClassName()
constructors, and from PHP7, the old style is marked as deprecated, so in future versions, SameAsClassName()
will not be allowed any more.
I am just wondering about the rationale about this decision. The manual does not give any reasons for that change. What are the advantages of the using __construct() vs SameAsClassName() ?
Sidenote: in my code-base where there are about 2000 classes, this change causes the need for renaming every class manually to the __construct.
__construct
constructors were already in php5 so if you have a php4 codebase then there is a lot more to fix..