title: Traits; parent & self type-hints in PHP 5.4
body: <p>While this question is somewhat language agnostic (<em>agnostic as far as OOP languages that support Traits</em>) I've been tinkering with the nightly builds of PHP 5.4a, and came across an odd scenario. I can't seem to get my install to run anymore, but that's another story.</p>
  
  <p>Given the following snippet:</p>
  
  <pre><code>trait MyTrait
  {
  
      public function myMethod(self $object)
      {
          var_dump($object);
      }
  
  }
  
  class MyClass
  {
  
      use MyTrait;
  
  }
  
  $myObject = new MyClass();
  $myObject-&gt;myMethod('foobar'); // &lt;-- here
  </code></pre>
  
  <p>What should happen? I would hope for an error, indicating <code>$object</code> needs to be an instance of <code>MyClass</code>.</p>
  
  <p>When trait methods are copied into a <code>use</code>-ing class, are they copied verbatim, as to resolve class inheritance references like these? Is this the intended functionality of a Trait? (<em>I've not worked with another language that supported them</em>)</p>