bug32596.phpt 597 B

1234567891011121314151617181920212223242526
  1. --TEST--
  2. Bug #32596 (Segfault/Memory Leak by getClass (etc) in __destruct)
  3. --FILE--
  4. <?php
  5. class BUG {
  6. public $error = "please fix this thing, it wasted a nice part of my life!\n";
  7. static function instance() {return new BUG();}
  8. function __destruct()
  9. {
  10. $c=get_class($this); unset($c);
  11. echo get_class($this) ."\n";
  12. if(defined('DEBUG_'.__CLASS__)){}
  13. $c=get_class($this); //memory leak only
  14. echo $this->error;
  15. }
  16. }
  17. BUG::instance()->error;
  18. echo "this is still executed\n";
  19. ?>
  20. --EXPECT--
  21. BUG
  22. please fix this thing, it wasted a nice part of my life!
  23. this is still executed