The value of a class constant in PHP can be changed after it is defined.
- TRUE
- FALSE
- nan
- nan
The value of a class constant in PHP cannot be changed after it is defined. Once a constant is assigned a specific value, it remains the same throughout the execution of the script. Constants are considered as read-only values. It's important to note that attempting to modify a constant's value will result in a runtime error. To maintain the immutability of constant values, it is recommended to define them with the desired value and avoid any attempts to modify them later. To know more, refer to: http://php.net/manual/en/language.constants.php
Loading...
Related Quiz
- The PHP interpreter executes comments as part of the script.
- To sort an associative array by its keys in PHP, you use the ksort() function or the krsort() function for ______ order.
- Which of the following are ways to upload a file in PHP?
- What are the differences between a class constant and a class variable in PHP?
- The strlen() function in PHP can be used to find the number of words in a string.