Which of the following are true about constants in PHP?

  • Constants cannot be changed once defined
  • Constants are always case-sensitive
  • Constants can be accessed anywhere in the script
  • All of the above
All of the above options are true about constants in PHP. Constants in PHP are values that cannot be changed or redefined once defined. They are case-sensitive, meaning that the constant names are treated as case-sensitive identifiers. Constants can be accessed anywhere in the script without regard to scope rules. These characteristics make constants useful for storing fixed values that remain consistent throughout the script's execution. Learn more: https://www.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 *