:: Operator
Posted: Wed Feb 14, 2007 3:25 am
Can you tell me about the :: operator in PHP?
thanks,
Hung.
thanks,
Hung.
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
class Foo
{
function doSomething() {}
}
echo Foo::doSomething();Code: Select all
class Foo
{
public static function doSomething() {}
}
echo Foo::doSomething();Code: Select all
class Parent
{
public function __construct()
{
$this->doSomething();
}
}
class Child extends Parent
{
public function __construct()
{
parent::__construct();
}
}
$foo = new Child; // doSomething() is executed.