Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2016
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.44 KB | None | 0 0
  1. <?php
  2. class Tree
  3. {
  4.     public function __construct()
  5.     {
  6.         var_dump('good');
  7.     }
  8.    
  9.     public function __destruct()
  10.     {
  11.         var_dump('bad');
  12.     }
  13. }
  14.  
  15. class Candy
  16. {
  17.     public function ThrowError()
  18.     {
  19.         TRIGGER_ERROR('Go', E_USER_ERROR);
  20.     }
  21.    
  22.     public function HandleError()
  23.     {
  24.         exit;
  25.     }
  26.    
  27.     public function Go()
  28.     {
  29.         set_error_handler([$this, 'HandleError']);
  30.         return new Tree($this->ThrowError());
  31.     }
  32. }
  33.  
  34. $C = new Candy();
  35. $C->Go();
  36.  
  37. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement