out-of-memory-in-fiber.phpt 463 B

12345678910111213141516171819202122232425
  1. --TEST--
  2. Out of Memory in a fiber
  3. --INI--
  4. memory_limit=2M
  5. --SKIPIF--
  6. <?php
  7. if (getenv("USE_ZEND_ALLOC") === "0") {
  8. die("skip Zend MM disabled");
  9. }
  10. ?>
  11. --FILE--
  12. <?php
  13. $fiber = new Fiber(function (): void {
  14. $buffer = '';
  15. while (true) {
  16. $buffer .= str_repeat('.', 1 << 10);
  17. }
  18. });
  19. $fiber->start();
  20. ?>
  21. --EXPECTF--
  22. Fatal error: Allowed memory size of %d bytes exhausted%s(tried to allocate %d bytes) in %sout-of-memory-in-fiber.php on line %d