title: Relocating and renaming classes using namespaces
body: <p>I have a number of older classes that I'd like to transition into a <a href="http://groups.google.com/group/php-standards/web/psr-0-final-proposal" rel="nofollow">PSR-0</a> style directory. I'd like a sanity check on my process.</p>
  
  <ol>
  <li>Rename and relocate the existing <code>FooPerson.class.php</code> file to <code>Foo/Person.php</code>.</li>
  <li>Create <code>namespace Foo</code> in <code>Person.php</code>, and update all class references to be namespace-compatible as appropriate.</li>
  <li><p>For compatibility with old code, create a new <code>FooPerson.class.php</code> with this content:</p>
  
  <pre><code>&lt;?php
  
  require 'autoload.php'; // our psr-0 autoloader
  class_alias( '\Foo\Person', 'FooPerson' );
  </code></pre></li>
  </ol>
  
  <p>My hope is that this will enable transparent instantiation using either <code>new FooPerson</code> or <code>new \Foo\Person</code>. Initial testing seems to support this. Are there pitfalls I should be aware of?</p>