title: How do I bind a closure created inside a static function to an instance
body: <p>this seem not to work and I don't know why?
  you can create static closures inside non static methods, why not vice versa?</p>
  
  <pre><code>class RegularClass {
      private $name = 'REGULAR';
  }
  
  class StaticFunctions {
      public static function doStuff()
      {
          $func = function ()
          {
              // this is a static function unfortunately
              // try to access properties of bound instance
              echo $this-&gt;name;
          };
  
          $rc = new RegularClass();
  
          $bfunc = Closure::bind($func, $rc, 'RegularClass');
  
          $bfunc();
      }
  }
  
  StaticFunctions::doStuff();
  
  // PHP Warning:  Cannot bind an instance to a static closure in /home/codexp/test.php on line 19
  // PHP Fatal error:  Using $this when not in object context in /home/codexp/test.php on line 14
  </code></pre>