title: How do I get an object's unqualified (short) class name?
body: <p>How do I check the class of an object within the PHP name spaced environment without specifying the full namespaced class.  </p>
  
  <p>For example suppose I had an object library/Entity/Contract/Name. </p>
  
  <p>The following code does not work as get_class returns the full namespaced class. </p>
  
  <pre><code>If(get_class($object) == 'Name') {
  ... do this ...
  }
  </code></pre>
  
  <p>The namespace magic keyword returns the current namespace, which is no use if the tested object has another namespace. </p>
  
  <p>I could simply specify the full classname with namespaces, but this seems to lock in the structure of the code.  Also not of much use if I wanted to change the namespace dynamically. </p>
  
  <p>Can anyone think of an efficient way to do this.  I guess one option is regex.  </p>