title: Assign class variable to function and call
body: <p>Looking for the way to assign a function to a class variable and then call it.</p>
  
  <p>I know you can assign the class var to another variable and then call it, but I am looking for a way to call without creating temporary variables and cluttering up my code.</p>
  
  <p>Are temporary variables or using <code>call_user_func()</code> my only options?</p>
  
  <pre class="lang-php prettyprint-override"><code>class MyClass {
      public $callMe;
      public function __construct() {
          $this-&gt;callMe = function(...$args) {
              print_r(['HIT', $args]);
          };
  
          // $this-&gt;callMe('asd', 'sda');
          // Error: PHP Fatal error:  Call to undefined method test::callMe()
  
          // This works, but I would prefer not to create temporary variables for this
          $tmp = $this-&gt;callMe;
          $tmp('sd','adsf','fdas');
      }
  }
  </code></pre>