title: Why can I call non-static function without declaring the class object?
body: <p>I am using Symfony 1.0, and I have this <code>MyClassInc.class.php</code> in my <code>project/lib</code> folder</p>
  
  <pre><code>class MyClassInc {
    public function validateFunction ($params) {
      // my codes
    }
    static function testFunction ($params){
      // my codes
    }
  }
  </code></pre>
  
  <p>Then, my action <code>actions.class.php</code> in my <code>project/apps/myapps/modules/actions</code>.</p>
  
  <pre><code>class inventoryCycleCountActions extends sfActions
  {
    public function validateOutstandingTransaction () {
      $res0 = MyClassInc :: validateFunction($param); // It works
      $res1 = MyClassInc :: testFunction($param); // It works
      $myClass = new MyClassInc();
      $res2 = $myClass-&gt;validateFunction($param); // still works
      $res3 = $myClass-&gt;testFunction($param); // still works, da hell?
    }
  }
  </code></pre>
  
  <p>I tried to clear my cache folder to do re-test, but it seems that all of those work just fine.</p>
  
  <p><strong>Question:</strong>
  So.. WHY? and which one should I use? Does it have any effect with performance or anything?</p>
  
  <p><strong>Update 1:</strong></p>
  
  <pre><code>class MyClassInc {
    public function isProductValidated ($product){
      return true;
    }
    public function validateFunction ($params) {
      // IF, I call by using "$res0".. Throws error
      //
      $this-&gt;isProductInLoadPlans($product);
    }
  }
  </code></pre>
  
  <p>If I call validateFunction via <strong><em>$res0</em></strong>, it will throw this error:</p>
  
  <blockquote>
    <p>sfException: Call to undefined method
    inventoryCycleCountActions::isProductValidated.</p>
  </blockquote>
  
  <p><strong>And</strong>, if I call it via <strong><em>$res2</em></strong>, it works just fine.</p>
  
  <p>Since, I am currently using <strong><em>$res0</em></strong> and so I have to call that method like this instead.</p>
  
  <blockquote>
    <p>MyClassInc :: isProductValidated ($product)</p>
  </blockquote>