title: Why PHP uses static methods in object context?
body: <p>I have the following code (like, for real, this is my real code) :</p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php
  class Foobar
  {
    public static function foo()
    {
      exit('foo');
    }
  }
  </code></pre>
  
  <p>When I run <code>$foobar = new FooBar; $foobar-&gt;foo()</code> it displays <code>foo</code>.</p>
  
  <p>Why would PHP try to use a static method in an object context ? Is there a way to avoid this ?</p>
  
  <hr>
  
  <p>Ok you guys didn't get my problem : I know the differences between static and non static methods and how to call them. That's my whole point, if I call <code>$foobar-&gt;foo()</code>, why does PHP tries to run a static method ?</p>
  
  <hr>
  
  <p>Note : I run PHP 5.4.4, error reporting to <code>E_ALL</code>.</p>