Advertisement
Guest User

Untitled

a guest
Feb 20th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. <?php
  2. class A {
  3. public static function who() {
  4. echo __CLASS__;
  5. }
  6. public static function test() {
  7. static::who(); // Here comes Late Static Bindings
  8. }
  9. }
  10.  
  11. class B extends A {
  12. public static function who() {
  13. echo __CLASS__;
  14. }
  15. }
  16.  
  17. B::test();
  18. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement