Which of the following are differences between variables and constants in PHP?

  • Variables can be changed during the execution of the script, while constants cannot
  • Variables are case-sensitive, while constants are case-insensitive
  • Variables need to be explicitly declared using the $ sign, while constants do not need explicit declaration
  • All of the above
All of the above options are differences between variables and constants in PHP. Variables in PHP can have their values changed during the execution of the script, whereas constants are fixed and cannot be modified once defined. Variables are case-sensitive, meaning that different cases of the same variable name are treated as separate entities. On the other hand, constants are case-insensitive, allowing for consistent access regardless of the case used. Variables need to be explicitly declared using the $ sign, while constants do not require explicit declaration statements. Learn more: https://www.php.net/manual/en/language.variables.basics.php 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 *