bug78010.phpt 674 B

1234567891011121314151617181920212223242526272829303132
  1. --TEST--
  2. Bug #78010: Segmentation fault during GC
  3. --INI--
  4. memory_limit=2G
  5. --FILE--
  6. <?php
  7. class foo
  8. {
  9. public function __construct()
  10. {
  11. $this->x = $this;
  12. for ($i = 0; $i < 898; $i++) { //Will not trigger with <898
  13. $obj = [new stdClass, new stdClass]; //This must have at least 2 elements
  14. $this->y[] = $obj;
  15. }
  16. }
  17. }
  18. for ($i = 0; $i < 2; ++$i) { //This must run >=2 (increasing the number of elements in the array *2 will not do)
  19. $x = []; //This must be reset
  20. foreach (array_fill(0, 389, 'x') as &$params) { //Will not trigger <389
  21. $x[] = new foo;
  22. }
  23. }
  24. echo "Completed\n";
  25. ?>
  26. --EXPECT--
  27. Completed