Get value of dynamically chosen class constant in PHP October 28, 2022 by Tarik Use the constant() function: $id = constant("ThingIDs::$thing");