Given a piece of code such as:
{$globalScript->qtip(active_page::getCurrentPageName()=='factsheet','../')}
What's the difference in usage in PHP 5 between "->" and "::"?
-> calls the instance (object) method and :: calls the class method, which is defined with the keyword static.
You can read more about that here : http://php.net/manual/en/language.oop5.php and especially here : http://www.php.net/manual/en/language.oop5.paamayim-nekudotayim.php.
in -> you are calling a public method in an object instance
and in :: you are calling a static method
Ex:
Class MyClass {
public function doStuff(){
// stuff
}
public static function doStaticStuff (){
// other stuff
}
}
$obj = new MyClass();
$obj->doStuff(); // works
// in static you dont need to creat a new object
MyClass::doStaticStuff();
MyClass::doStuff(); // will fail here
// but you can also call the static method on an existing object
$obj::doStaticStuff();