Advertisement
fruffl

Untitled

Jun 23rd, 2013
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.83 KB | None | 0 0
  1.     class a
  2.     {
  3.     }
  4.    
  5.     class b
  6.     {  
  7.         protected function __construct($x)
  8.         {
  9.         }
  10.     }
  11.    
  12.     class c extends b
  13.     {
  14.         protected function __construct(a $x)
  15.         {
  16.             $this->t($x);
  17.         }
  18.     }
  19.  
  20.  
  21.  
  22.  
  23. //
  24.  
  25.     class a
  26.     {
  27.     }
  28.    
  29.     class b
  30.     {
  31.         static function t($x)
  32.         {
  33.             return new self($x);
  34.         }
  35.     }
  36.    
  37.     class c extends b
  38.     {
  39.         static function t(a $x)  // Declaration of c::t() should be compatible with b::t($x)
  40.         {
  41.             return new self($x);
  42.         }
  43.     }
  44.  
  45.  
  46. //
  47.  
  48.  
  49.     class a
  50.     {
  51.     }
  52.    
  53.     class b
  54.     {  
  55.         protected function __construct($x)
  56.         {
  57.         }
  58.     }
  59.    
  60.     class c extends b
  61.     {
  62.         public function __construct(a $x)
  63.         {
  64.         }
  65.     }
  66.  
  67.  
  68. //
  69.  
  70.  
  71.     class a
  72.     {
  73.     }
  74.    
  75.     class b
  76.     {
  77.         protected static function t($x)
  78.         {
  79.             return new self($x);
  80.         }
  81.     }
  82.    
  83.     class c extends b
  84.     {
  85.         public static function t($x)
  86.         {
  87.             return new self($x);
  88.         }
  89.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement