what is the function of self keyword in php
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/151969/php-self-vs-this">PHP: self vs. $this</a>  </p>
</blockquote>



<p>it is from php manual, please let me know where and why i use self keyword</p>

<pre><code>&lt;?php
class Foo
{
    public static $my_static = 'foo';

    public function staticValue() {
        return self::$my_static;
    }
}

class Bar extends Foo
{
    public function fooStatic() {
        return parent::$my_static;
    }
}


print Foo::$my_static . "\n";

$foo = new Foo();
print $foo-&gt;staticValue() . "\n";
print $foo-&gt;my_static . "\n";      // Undefined "Property" my_static 

print $foo::$my_static . "\n";
$classname = 'Foo';
print $classname::$my_static . "\n"; // As of PHP 5.3.0

print Bar::$my_static . "\n";
$bar = new Bar();
print $bar-&gt;fooStatic() . "\n";
?&gt; 
</code></pre>
