hi all..
can sombody explain in a few lines what is the difference in calling a class function in this cases:
case 1: $moo = new foo(); $n = $moo->give(5+5); and case 2: $n = foo::give(5+5);
thanks...
in the second case is method give() called statically, in the second one is called a method on instance of foo object..
for more info:
http://mirrors.inway.cz/manual/en/language.oop5.php
in the second one is called a method on instance of foo ob....
you mean 'in the first one'?!....
i'll check the link, thanks, but how do i load the class for the static call? or how does the script know where to find it?
Exactly the same way it would find it for the instance call.
(One difference that should be pointed out between static and instance calls: you can't use $this in a static method - because there's no object for "$this" to refer to.)