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
Loading...
Related Quiz
- What is the $_POST superglobal in PHP?
- You have a PHP script and you need to call a user-defined function using a string variable. How would you do this?
- If the file to be included using the include statement in PHP is not found, the script will ______.
- The switch statement in PHP can only test a single condition.
- The asort() function in PHP sorts an associative array in ascending order based on its values, while maintaining the association between keys and values.