A constant of a PHP class can be accessed using the class name followed by the scope resolution operator (::) and the constant name.

  • TRUE
  • FALSE
  • nan
  • nan
A constant of a PHP class can indeed be accessed using the class name followed by the scope resolution operator :: and the constant name. For example: ClassName::CONSTANT_NAME This allows you to directly reference the value of a constant defined within a class without the need for object instantiation. The scope resolution operator :: is used to access static members, including constants, of a class. To learn more, visit: http://php.net/manual/en/language.oop5.constants.php
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *