title: How to force arguments to be integer/string
body: <p>I'd like my functions to expect strings/integers or throw a fit, like:</p>
  
  <blockquote>
    <p>warning: preg_match() expects parameter 2 to be string</p>
  </blockquote>
  
  <p>However for this function</p>
  
  <pre><code>public function setImage($target, $source_path, integer $width, integer $height){...
  </code></pre>
  
  <p>I get: </p>
  
  <blockquote>
    <p>Argument 4 passed to My_Helper_Image::setImage() must be an instance of integer, integer given</p>
  </blockquote>
  
  <p>But:</p>
  
  <pre><code>function(array $expectsArray)
  </code></pre>
  
  <p>works as I expect, how would I achieve the same effect as with integers and strings?</p>
  
  <p><strong>Big Update</strong></p>
  
  <p>PHP 7 now <a href="http://php.net/manual/en/migration70.new-features.php" rel="noreferrer">supports Scalar Type Hinting</a></p>
  
  <pre><code>function increment(int $number) {
       return $number++;
  }
  </code></pre>