The top is a new way that it has been doing in PHP since version 5.0 and how all new code should be written. The latter is an old way of PHP 4 and is deprecated. At some point it will be completely out of date and generally removed from PHP.
Update
Starting with PHP 5.3.3 , methods with the same name as the last element of the class name with names will no longer be considered as a constructor. This change does not affect classes that do not contain names.
<?php namespace Foo; class Bar { public function Bar() {
John conde
source share