bug60598.phpt 721 B

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