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

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -