Advertisement
Serafim

Untitled

Jan 24th, 2014
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.38 KB | None | 0 0
  1. <?php
  2. abstract class Some
  3. {
  4.     public static function test()
  5.     {
  6.         self::bla();    // Some::bla
  7.         static::bla();  // Any::bla
  8.     }
  9.  
  10.     protected static function bla()
  11.     {
  12.         echo "Вызываем Some\n";
  13.     }
  14. }
  15.  
  16. class Any extends Some
  17. {
  18.     protected static function bla()
  19.     {
  20.         echo "Вызываем Any\n";
  21.     }
  22. }
  23.  
  24.  
  25. Any::test();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement