You can access a constant of a PHP class using the class name followed by the scope resolution operator (::) and the constant name like ClassName::CONSTANT_NAME.

  • TRUE
  • FALSE
  • nan
  • nan
In PHP, you can access a constant of a class 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 *