context of self
<p>When I see a 'self' automatically to think of static methods. Lately I have been pointed out that self depends on the context. Just like 'parent', which can also call static methods. Consider this example:</p>

<pre><code>error_reporting(-1);

class A
{
    public $var = 1;

    public function __construct($n)
    {
        $this-&gt;var = $n;

        self::foo();
    }

    public function foo()
    {
        echo $this-&gt;var;
    }
}

$obj = new A(5);
</code></pre>

<p>Operate without errors and within the method foo $ this is available.
Someone can tell me some guide that explains in detail how the calls are resolved by self and parent?</p>
