Posted by peter on 03/23/07 15:38
>I can call a class using "->", but it complains about the ::
> I see on the net where :: is used. Is there a good explanation on when
> to use one over the other or the differences?
>
> $help = new help();
> $help->foo();
> $help::foo();
>
>
> class help{
>
> function foo(){
> echo "test";
> }
> }
>
:: is used to call class methods or properties when the class has not been
initiated:-
http://www.php.net/manual/en/keyword.paamayim-nekudotayim.php
Navigation:
[Reply to this message]
|