I think you misunderstand what constant() is being used for. If you only need to access a constant, do it directly: print FOO;
If you don't know what constant you want to access, you need constant(). I.e. you can do "variable variables" like this:
$name = 'var1';
$var1 = 'value something or other';
print $$name; // prints the value of $var1: 'value something or other' because:
${$name} -> ${"var1"} -> $var1 -> 'value something or other'
I.e. you are substituting the name of the variable through a variable.
You can't do this with constants:
$name = 'CONST1';
define('CONST1', 'value something or other');
print $name; // prints the value of $name: 'CONST1'
You'll need to use constant():
print constant($name); // prints 'value something or other'