PHP Case Sensitivity

Basically names of user-defined functions, classes, built-in constructs and keywords such as echo, while, class, etc., are case-insensitive. However; variables on the other hand, are case-sensitive.

In the example below, all three echo statements below are legal (and equal):

PHP Case Sensitivity Example 1

<html>
<head>
<title>PHP Comments</title>
</head>
<body>
<?php   
echo("hello, world!");
ECHO("hello, world!");
EcHo("hello, world!");
?>
</body>
</html>

However; variables on the other hand, are case-sensitive. That is, $variable, $VARIABLE, $VariaBle and $VAriable are four different variables.

PHP Case Sensitivity Example 2

<html>
<head>
<title>PHP Comments</title>
</head>
<body>
<?php   
$variable = "pen";
ECHO "This is my ". $variable . "<br/>";
ECHO "This is my ". $VARIABLE . "<br/>";
$VARIABLE = "shirt";
ECHO "This is my ". $VARIABLE . "<br/>";
ECHO "This is my ". $VariaBle . "<br/>";
$VariaBle = "car";
ECHO "This is my ". $VariaBle . "<br/>";
?>
</body>
</html>

This will produce following result

This is my pen
This is my
This is my shirt
This is my
This is my car