File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / Zend / tests / bug32596.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:47:52 2012 UTC (13 years, 1 month ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, v5_3_10, HEAD
php

    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: 
    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: 
   20: BUG::instance()->error;
   21: echo "this is still executed\n";
   22: ?>
   23: --EXPECT--
   24: BUG
   25: please fix this thing, it wasted a nice part of my life!
   26: this is still executed
   27: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>