title: use of callable in php
body: <p>I am trying to mimic php's inbuilt usort function definition in my implementation below:</p>
  
  <pre><code>class heapSort {
      static function hsort(array &amp;$array, callable $cmp_function){
         // logic
      }
  }
  
  class utility{
      static function mycomparator(){
          // logic
      }
  }
  
  $array = array(5,3,8,1);
  $callback = array('utility','mycomparator');
  heapSort::hsort($array, $callback);
  </code></pre>
  
  <p>While the variable <code>$callback</code> is "callable" why do I get below fatal error?</p>
  
  <blockquote>
    <p>Argument 2 passed to heapSort::hsort() must be an instance of callable.</p>
  </blockquote>
  
  <p>More specifically, how do I make/typecast a <code>$variable</code> to callable?</p>