 <p>i don't know if i'm missing something, but with this: </p> <p><a href="http://php.net/manual/en/reflectionclass.getnamespacename.php" rel="nofollow">http://php.net/manual/en/reflectionclass.getnamespacename.php</a>, i think that you can get namespace of the object you are using.</p>