I'd like to use constants as config variables within my PHP applications, only when a constant doesn't exist (for whatever reason) it throws me a notice but I'd like that to be an error (or exception), just like when I try to echo a not existing variable.
Is that possible without using a separate function for getting constant values, something like this:
echo $non_existing_variable; // Error
echo NON_EXISTING_CONSTANT; // Now also an error
Been searching around a bit but couldn't find anything.
Seems kind of logical to me, when I try to use a variable that doesn't exist code execution quits immediately and throws an error, why isn't that with constants?