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
  • 28,097
  • 9
  • 82
  • 87

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
  • 479,566
  • 201
  • 878
  • 984