I'd like to use constants as config variables within my PHP applications, only when an constant doesn't exist (for whatever reason) it throws me an notice but i'd like that to be a error (or exception) just like when i try to echo a not existing variable.
Is that possible without using a seperate 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 a logical to me, when i try to use a variable that doesn't exist code execution quits immediatly and throws a error, why isn't that with constants?