title: PHP OO retry logic implementation and passing dynamic method and args
body: <p>My first question here.</p>
  
  <p>The question is similar to this one: <a href="https://stackoverflow.com/questions/712161/php-retrying-a-query-a-set-number-of-times-or-until-success">PHP: Retrying a query a set number of times or until success</a></p>
  
  <p>Try till success in OO way.
  Here example what i'm trying to do:</p>
  
  <pre><code>class Creatives {
  
      public function run() {
          $auth_token='mypassword';
          $id=123123;
          $this-&gt;retry_till_success ( $this-&gt;getCreatives, array($auth_token, $id) );
          print $this-&gt;creatives; 
      }
  
      public function getCreatives($auth_token, $id) {
          $this-&gt;creatives = $this-&gt;campagin-&gt;get($auth_token, $id);      
      }
  
      private function retry_till_success($method, $args) {
          do {
              $try_again = false;
              try {
                  /* how to call the method with */
                  /* call user method with params pass */
                  /* do until success */
              } catch (SoapFault $fault) {
                  if($fault-&gt;faultstring== 'couldnt connect to host')
                      $try_again=true;
              }
          } while ($try_again);
      }
  }
  </code></pre>
  
  <p>i read about call_user_func, but don't know if i could use it inside the class,
  I need to make 99.9% success rate in my calls, any suggestion to achieve this will be great.
  thank you.</p>