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