Is PHP a case sensitive language?

In PHP, variable names are case-sensitive but function names are not case sensitive.

Explanation:

  • If you defined variable in lowercase, then you need to use it in lowercase everywhere in the program. If we define a variable $name = "James"; then we must need to use $name. $NAME will not work
  • If you defined function name in lowercase, but calling them in uppercase it will work. For example, If we define function sum() {} then calling SUM() will also work.
Note: Function names are case-insensitive, though it is good to call functions in the same case as they appear in their declaration for consistency.

Learn more about the similar topics:
Tutorials
PHP Variables
Exercises & Assignments
Write a program to print “Hello World” using echo
Write a program to print “Hello PHP” using variable
Write a program to print a string using echo+variable.
Write a program to print two variables in single echo
Interview Questions & Answers
Is PHP a case sensitive language?
What are the different data types in PHP?