Re: Question on syntax...

From: Date: Wed, 20 Aug 2003 15:11:41 +0000
Subject: Re: Question on syntax...
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-160191@lists.php.net to get a copy of this message
On 20 Aug 2003 09:57:20 -0500, you wrote: >I've seen this a few times in some code examples... > >XXX::XXX > >What do the 2 colons signify? Static method of an object. Calling a method of a class without first instantiating an instance of the class. /* Class A has method B */ class A { function B ($s = "None") { echo ("<p> input : $s</p>"); } } /* $C is an instance of A */ $C = new A (); /* invoke A::B */ A::B ('call 1'); /* invoke $C->B */ $C->B ('call 2');

« previous php.general (#160191) next »