Constants
suggest changeSyntax
define(string $name, mixed $value, bool $case_insensitive = false)— the third argument was deprecated in PHP 7.3 and removed in PHP 8.0. Constants are case-sensitive.const CONSTANT_NAME = VALUE;
Remarks
Constants are used to store the values that are not supposed to be changed later. They also are often used to store the configuration parameters especially those which define the environment (dev/production).
Constants are typed, but not every value was always allowed. Arrays are allowed in const from PHP 5.6 and in define() from PHP 7.0. Since PHP 8.1, a const expression may include new. On current PHP, define() also accepts objects and resources; that will not work on PHP 7. Class constants still have to be constant expressions, so you cannot assign an arbitrary runtime value with const.
Some constant names are reserved by PHP. These include true, false, null as well as many module-specific constants.
Constants are usually named using uppercase letters.