note 99339 deleted from language.oop5.late-static-bindings by danbrown
| From: | danbrown@php.net | Date: | Wed, 11 Aug 2010 20:19:15 +0000 |
| Subject: | note 99339 deleted from language.oop5.late-static-bindings by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-171583@lists.php.net to get a copy of this message | ||
Note Submitter: gaosipov at gmail dot com
----
Interest behavior of self, shows that it is not absolutely correct, that self:: are resolved using
the class in which the function belongs
<?
class A
{
static function f()
{
print get_called_class();
}
static function g()
{
self::f();
}
}
class B extends A { /* empty */ }
B::f();
B::g();
?>
The output will be «BB», this shows that A::f called by self:: in A still refers to B.