In PHP, keywords and constants are case-insensitive, meaning they can be written in either lower case or upper case without affecting their
functionality. This allows for more flexibility and ease of use when writing code.
However, it is generally recommended to follow a consistent casing convention for readability and maintainability purposes. Relevant constants are
true
, false
and null
.
Note that if the Drupal framework is detected, this rule will enforce Drupal standards instead. Relevant constants are TRUE
,
FALSE
and NULL
.
Noncompliant code example
<?php ECHO 'Hello World'; ?>
<?php
// In a Drupal context
const CACHE_ENABLED = true;
?>
Compliant solution
<?php echo 'Hello World'; ?>
<?php
// In a Drupal context
const CACHE_ENABLED = TRUE;
?>