for checking if something is inside you can use (since PHP 5.5) the empty function. to avoid errors I would also check if it is even existing.
if(defined('FOO')&&!empty(FOO)) {
//we have something in here.
}
since empty also evaluates most false
-like expressions (like '0', 0 and other stuff see http://php.net/manual/de/function.empty.php for more) as 'empty'
you can try:
if(defined('FOO') && FOO ) {
//we have something in here.
}
this should work maybe with more versions (probably everywhere where you can get yoda conditions to run)
for a more strict check you could do:
if(defined('FOO') && FOO !== '') {
//we have something in here.
}