title: Parent/child type hinting in php constructor?
body: <p>Without getting into whether or not I should be using type hinting, can anyone tell me if there is a way to avoid PHP throwing an error when I pass a child class into a constructor that type hints for the parent? E.g.:</p>
  
  <pre><code>class Headed extends Image { ... }
  
  class Dimension {
      function __construct(Image $image, $arg1, $arg2){ ... }
  }
  </code></pre>
  
  <p>PHP gives me:</p>
  
  <pre><code>PHP Error 4096: Argument 1 passed to Dimension::__construct() must be an instance of Image, instance of Headed given
  </code></pre>
  
  <p>An object of type Headed would obviously also be an Image, since it is a child class, is there some way of phrasing my constructor so it gives the type hint but allows children? </p>
  
  <p><em>If this is due to me using PHP 5.2.5 instead of a more recent version than I'm sorry for bothering everyone.</em></p>