class - PHP difference when instantiating a new object? -


this question has answer here:

i have seen in many websites showing examples of instantiating objects.

$obj = new foo; 

which straight forward, have seen this:

$obj = new foo(); 

is there difference? far noticed both same.

there no difference, matter of opinion. if foo had constructor parameters need use new foo($param);


Comments

Popular posts from this blog

iphone - Three second countdown in cocos2d -

hyperlink - how to do url routing in php -

c - Avoiding Extra Malloc in Linked List (node->next = NULL) -