bug70258.phpt 548 B

12345678910111213141516171819202122232425262728
  1. --TEST--
  2. Bug #70258 (Segfault if do_resize fails to allocated memory)
  3. --INI--
  4. memory_limit=2M
  5. --SKIPIF--
  6. <?php
  7. $zend_mm_enabled = getenv("USE_ZEND_ALLOC");
  8. if ($zend_mm_enabled === "0") {
  9. die("skip Zend MM disabled");
  10. }
  11. ?>
  12. --FILE--
  13. <?php
  14. class A {
  15. public $arr;
  16. public function core() {
  17. $this->arr["no_pack"] = 1;
  18. while (1) {
  19. $this->arr[] = 1;
  20. }
  21. }
  22. }
  23. $a = new A;
  24. $a->core();
  25. ?>
  26. --EXPECTF--
  27. Fatal error: Allowed memory size of 2097152 bytes exhausted%s(tried to allocate %d bytes) in %s on line %d