0

I have seen some constants prefixed with double colons like

::DATE_FORMAT

What does this mean, and how are they different from the normal constants ?

Santhosh
  • 26,663
  • 9
  • 73
  • 86

1 Answers1

2

It's the scope resolution operator. With an empty LHS, it is scoping to global.

It would be used when simply accessing the property/method/etc by its name alone would be ambiguous, e.g. a DATE_FORMAT available in scope which isn't the one you're after.

alex
  • 460,746
  • 196
  • 858
  • 974