title: passing arguments with an array based object method call
body: <p>I need to call a method from within a function, so I must pass it as an array like so:</p>
  
  <pre><code>array($this, 'display_page');
  </code></pre>
  
  <p>but I need to pass arguments along with it. Is this possible?</p>
  
  <p><strong>EDIT</strong> - <em>New Method</em> - <em>Still not working.</em></p>
  
  <p>I have now tried passing an anonymous function, in place of the array call back.</p>
  
  <pre><code>function(){MyClass::display_page($display);}
  </code></pre>
  
  <p>and edited the function thusly:</p>
  
  <pre><code>class MyClass{
  
  static function display_page($arg = false)
      {
        if($arg){
          echo $arg;
        } else {
          echo "Nothing to report!";
        }
       }
  }
  </code></pre>
  
  <p>but all I get is <strong>Nothing to report!</strong></p>
  
  <p><strong>EDIT</strong> The problem lies with the way the callback was being used within Wordpress (didn't think it was relevant, turns out it was). Have voted to close.</p>