Get the current hierarchy php page

Assuming that you’re wanting to determine which template page is currently being displayed, within the template hierarchy, the easiest way to do so is via the output of body_class().

However, if you need to return this information programmatically, the easiest way might be to call get_body_class(), and then evaluate the array of classes returned. Given the way that get_body_class() steps through each query conditional itself (and the template loader does likewise), I’m guessing that core doesn’t have a more abstracted approach.