title: PHP: bool vs boolean type hinting
body: <p>I've been trying to use type hinting more in PHP. Today I was writing a function that takes a boolean with a default parameter and I noticed that a function of the form</p>
  
  <pre><code>function foo(boolean $bar = false) {
      var_dump($bar);
  }
  </code></pre>
  
  <p>actually throws a fatal error:</p>
  
  <blockquote>
    <p>Default value for parameters with a class type hint can only be NULL</p>
  </blockquote>
  
  <p>While a function of the similar form</p>
  
  <pre><code>function foo(bool $bar = false) {
      var_dump($bar);
  }
  </code></pre>
  
  <p>does not. However, both</p>
  
  <pre><code>var_dump((bool) $bar);
  var_dump((boolean) $bar);
  </code></pre>
  
  <p>give the exact same output</p>
  
  <blockquote>
    <p>:boolean false</p>
  </blockquote>
  
  <p>Why is this? Is this similar to the wrapper classes in Java?</p>