If you are referencing class constant (either using namespaces or not, because one day you may want to start using them), you'll have the least headaches when doing it like this:
<?php
class Foo {
const BAR = 42;
}
?>
<?php
namespace Baz;
use \Foo as F;
echo constant(F::class.'::BAR');
?>
since F::class will be dereferenced to whatever namespace shortcuts you are using (and those are way easier to refactor for IDE than just plain strings with hardcoded namespaces in string literals)