title: PHP: constant as variable in function
body: <p>I'm trying to use constant as a function paramter, is it possible to check type of this constant.</p>
  
  <p>Example of what I want:</p>
  
  <pre><code>class ApiError {
    const INVALID_REQUEST = 200;
  }
  
  class Response {
    public function status(ApiError $status) {
      //function code here
    }
  }
  </code></pre>
  
  <p>USE:</p>
  
  <pre><code>$response = new Response();
  $response-&gt;status(ApiError::INVALID_REQUEST);
  </code></pre>
  
  <p>This shoud check that given $status is constant of class ApiError. Is something like this possible?</p>