Class Instantiation

Instantiation of an object should be done with parenthesis.

Valid: with parenthesis.

$a = new Foobar<em>()</em>;

Invalid: without parenthesis.

$a = new Foobar;
Don't use spaces between the object name and the open parenthesis when instantiating new object.

Valid: no whitespace between the object name and the parenthesis.

$a = new Foobar();

Invalid: a space between the object name and the parenthesis.

$a = new Foobar<em> </em>();
Assigning the return value of "new" by reference was deprecated in PHP 5.3 and removed in PHP 7.0. New by reference should no longer be used.

Valid: object instantiation without reference.

$a = <em>new</em> Foobar();

Invalid: object instantiation by reference.

$a = <em>& new</em> Foobar();