Late Static Bindings' usage
Posted on February 6, 2010, 1:57 pm UTC anonymously (about 1 month ago)Code (highlighted for PHP)
- <?php
- class A {
- public static function who() {
- echo __CLASS__;
- }
- public static function test() {
- static::who(); // Here comes Late Static Bindings
- }
- }
- class B extends A {
- public static function who() {
- echo __CLASS__;
- }
- }
- B::test();
- ?>