Do these two PHP OOP syntaxes yield the same result? -


in php, is:

$objectvar = someclassname::somefunction($var); 

the same as:

$object = new someclassname(); $objectvar = $object->somefunction($var); 

no.

$objectvar = someclassname::somefunction($var); 

here, somefunction static method; i.e. belongs class, not object.

$object    = new someclassname(); $objectvar = $object->somefunction($var); 

in code, instance method should accessed through object.

the result same, handle used call method different.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

android - layout with fragment and framelayout replaced by another fragment and framelayout -