Accessing class members
Posted: Mon Dec 18, 2006 5:04 pm
Hello all,
In my continuing quest to rewrite my code in OOP (I'm in the beginning stages), I would like to know the difference between "->" and "::". For instance:
So when would I need to use "::"?
Thanks.
In my continuing quest to rewrite my code in OOP (I'm in the beginning stages), I would like to know the difference between "->" and "::". For instance:
Code: Select all
class Foo{
public string = "string";
function write(){
echo "Hello, I'm a ".$this->string;
}
}
$bar = new Foo();
$bar->write();Thanks.