A constant in a PHP class is defined using the const keyword.

  • TRUE
  • FALSE
  • nan
  • nan
A constant in a PHP class is indeed defined using the const keyword. It allows you to define a constant within a class by specifying the constant name, the assignment operator =, and the desired value. For example: const CONSTANT_NAME = value; Constants are used to store values that remain the same throughout the execution of a script and cannot be changed once defined. They provide a convenient way to define and use fixed values within a class. Refer to: http://php.net/manual/en/language.constants.php
Add your answer
Loading...

Leave a comment

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