In PHP, a constant can be defined which then would not have $ , but the variable must have one. However, this is NOT a variable and is not a substitute for a variable. Constants are intended to be defined exactly once and do not change throughout the life of the script.
define('a', 'some value for a');
In addition, you cannot interpolate a constant value inside a double-quoted string or HEREDOC:
$a = "variable a" define('a', 'constant a'); echo "A string containing $a";
Finally, PHP can issue a notification for Use of undefined constant a - assumed 'a' and interpret it as an erroneously incorrect string "a" . Look in your error log to see if this is happening. In this case, "a" == TRUE valid because the string "a" nonempty and is compared with the boolean value TRUE.
echo a == TRUE ? 'true' : 'false';
source share