I have a database class that automatically sets up a connection to the database and does some basic input filtering and whatnot. I am looking at setting some predefined constants to adjust the behavior of the class methods. What should I set the values of the constants as? Since the values will never be referred to, or compared, directly but only in the context of the constant name does the value even matter?
One strategy I have come across is setting a constant to a bit value so that bitwise operators can be used to combine constants. In this case it doesn't look like that functionality will be necessary, but you never know.
Often I get messages like
Notice: Use of undefined constant CONSTANT_VALUE - assumed 'CONSTANT_VALUE'
Is this treating the constant like the string 'CONSTANT_VALUE' or the constant CONSTANT_VALUE? Should I be defining the value of my constants as strings of the same name to compensate for this? This occurs when I am using constants I know are defined at some point, like DOCUMENT_ROOT.
Am I missing a better practice that either of these?