"::" in php for calling non-static functions works out of class
<p>as far as i know, <code>::</code> is using for calling static functions and base class functions in a subclass. and as far as i know, usually we have to create an instance of a class for using it out of the class.  </p>

<pre><code>class a 
{
    public function foo()
    {
       //
    }
}
</code></pre>

<p>for using this class:</p>

<pre><code>$instance = new a();
$instance-&gt;foo();
</code></pre>

<p>but its possible that we call the <code>foo</code> function without creating any instance and only using <code>::</code>. for example the following code is written out of class and works well:</p>

<pre><code>a::foo();
</code></pre>

<p>why does it work? and how? </p>
