calling instance methods statically from within the class
<p>According to one of the man pages <a href="http://www.php.net/manual/en/language.oop5.static.php" rel="nofollow">http://www.php.net/manual/en/language.oop5.static.php</a> :</p>

<blockquote>
  <p>Calling non-static methods statically generates an E_STRICT level warning.</p>
</blockquote>

<p>But, this doesn't seem to be the case when the call is made from <em>inside</em> the class:</p>

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

class Test {
    private $id;
    function __construct($id) { $this-&gt;id = $id; }
    function id() { return $this-&gt;id; }

    function __toString() {
        return Test::id()
             . self::id()
             . static::id()
             . static::id()
             . call_user_func('Test::id')
             . call_user_func(array('Test', 'id'));
    }
}
$a = new Test('a');
$b = new Test('b');


echo "$a $b $a"; # aaaaaa bbbbbb aaaaaa
var_dump(error_get_last()); # NULL
</code></pre>

<p>Testing with php 5.4</p>

<p><strong>DEMO:</strong> <a href="http://codepad.viper-7.com/IKp9iX" rel="nofollow">http://codepad.viper-7.com/IKp9iX</a></p>

<p>I believe I've demonstrated:</p>

<ul>
<li>No E_STRICT warning is generated</li>
<li>That php magically corrects the static method call to an instance method call(accessing the instance variable <code>id</code> proves this).</li>
</ul>

<p><strong>edit-</strong>
I'd like to add that inserting <a href="http://www.php.net/debug_backtrace" rel="nofollow">debug_backtrace</a>() into the __toString call yields a call "type" of <code>-&gt;</code>, which means "method call".</p>

<p>Is this a bug, or a documented feature?</p>
