Optimize calls to get_class($obj) when we know the exact type of $obj.