File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / Zend / tests / bug60598.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Mon Oct 14 08:02:49 2013 UTC (11 years, 6 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, HEAD
v 5.4.20

    1: --TEST--
    2: Bug #60598 (cli/apache sapi segfault on objects manipulation)
    3: --FILE--
    4: <?php
    5: define('OBJECT_COUNT', 10000);
    6: 
    7: $containers = array();
    8: 
    9: class Object {
   10:     protected $_guid = 0;
   11:     public function __construct() {
   12: 		global $containers;
   13: 		$this->guid = 1;
   14:         $containers[spl_object_hash($this)] = $this;
   15:     }
   16:     public function __destruct() {
   17: 		global $containers;
   18:         $containers[spl_object_hash($this)] = NULL;
   19:     }
   20: }
   21: 
   22: for ($i = 0; $i < OBJECT_COUNT; ++$i) {
   23:     new Object();
   24: }
   25: 
   26: // You probably won't see this because of the "zend_mm_heap corrupted"
   27: ?>
   28: If you see this, try to increase OBJECT_COUNT to 100,000
   29: --EXPECT--
   30: If you see this, try to increase OBJECT_COUNT to 100,000

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