What is diffrent betwenn :: and ->

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
// create the graph
    $Graph =& Image_Graph::factory('graph', array(400, 300));
    // add a TrueType font
    $Font =& $Graph->addNew('ttf_font', 'Gothic');

I slice some of the code... so I do not really understand what is :: is
mean and function adn ->

is it its the same object refrence..

Re: What is diffrent betwenn :: and ->


Quoted text here. Click to load it

calls the *static* method "staticMethod" in ClassName.
:: is the operator the access static methods.
Static methods can be called without having an object of the concerning  
class. Therefore static methods (actually a function a class) may not  
use "$this".

$object->method() calls the method "method" of the object referenced by  
"$object". Non-static methods work with the state of the object they  
belong to.

If you still do not know the difference between static and non-static  
methods you should consult some OOP-explaining websites or books.

Hero Wanders

Site Timeline