Http://www.ibm.com/developerworks/opensource/library/os-php-5.3new1/index.html
StartArticleDescription
Some of them are translated as follows:
Late static bindings is a new feature added to php5.3. in pinyin, it is the expression originally fixed in the definition phase.
Or variable, which is determined only in the execution stage. For example, when a subclass inherits Static The value of an expression cannot be changed.
You do not want to see this situation
<? PHP
Class {
Public static function who (){
Echo _ class __;
}
Public static function test (){
SELF: WHO ();
}
}
Class B extends {
Public static function who (){
Echo _ class __;
}
}
B: Test (); // enter
?>
But now I want it to output B, so use late static bindings to achieve this feature.
<? PHP
Class {
Public static function who (){
Echo _ class __;
}
Public static function test (){
Static: WHO (); // late static bindings
}
}
Class B extends {
Public static function who (){
Echo _ class __;
}
}
B: Test (); // output B
?>