I would like to be able to do something like this:
class ThingIDs { const Something = 1; const AnotherThing = 2; } $thing = \'Something\'; $id = Thi
$id = constant("ThingIDs::$thing");
http://php.net/manual/en/function.constant.php
If you are using namespaces, you should include the namespace with the class.
echo constant('My\Application\ThingClass::ThingConstant');