HosipLan

Untitled

Jun 19th, 2011
416
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.61 KB | None | 0 0
  1. foo bar foo bar
  2. ---------------------
  3. <?php
  4.  
  5. require_once '/usr/include/php/nette/Nette/loader.php';
  6. Nette\Diagnostics\Debugger::enable();
  7. Nette\Diagnostics\Debugger::$strictMode = TRUE;
  8.  
  9.  
  10. class Foo
  11. {
  12.    
  13.     public function __construct()
  14.     {
  15.         echo " foo ";
  16.     }
  17.  
  18. }
  19.  
  20. class Bar extends Foo
  21. {
  22.    
  23.     public function __construct()
  24.     {
  25.         parent::__construct();
  26.  
  27.         echo " bar ";
  28.     }
  29.  
  30.  
  31.     public function fix()
  32.     {
  33.         $this->__construct();
  34.     }
  35.  
  36. }
  37.  
  38.  
  39. $bar = new Bar();
  40. $bar->fix(); // expected " foo bar foo bar
  41.  
  42. echo "<hr>"; highlight_file(__FILE__);
Advertisement
Add Comment
Please, Sign In to add comment