so, what is the difference between -> and :: ??
thanks
what is the difference between -> and ::
Moderator: General Moderators
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: what is the difference between -> and ::
The -> operator lets you access the object's properties and methods.
Found this in a book about object-orientated programming.
Scope resolution operator (::)
Found this in a book about object-orientated programming.
Scope resolution operator (::)
The scope resolution operator has the following uses:
It gives access to overridden properties or methods of a parent class.
It is used to call the static methods and properties of a class.
It gives access to class constants.
It is the conventional way of referring to a class method or property in documentation.
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering