mjs7231 wrote:
[color=blue]
> What is the difference between "::" and "->" when using classes?
>
> It always hard to find documentation for something that i only a
> symbol. :)[/color]
:: calls a class method statically - that is, you don't have to have an
instance of the class.
-> calls a class method as part of an object.
If you have something like:
require 'MyClass.php';
$x = new MyClass();
Then you'd use $x->method() to call the methods in the class as part of
the instance/object.
Comment