bug74240.phpt 458 B

1234567891011121314151617181920212223242526
  1. --TEST--
  2. Bug #74240 (deflate_add can allocate too much memory)
  3. --EXTENSIONS--
  4. zlib
  5. --FILE--
  6. <?php
  7. ini_set('memory_limit', '64M');
  8. $deflator = deflate_init(ZLIB_ENCODING_RAW);
  9. $bytes = str_repeat("*", 65536);
  10. // this crashes after about 500 iterations if PHP is
  11. // configured for 64M
  12. for ($i = 0; $i < 1000; $i++) {
  13. $output = deflate_add(
  14. $deflator,
  15. $bytes,
  16. ZLIB_SYNC_FLUSH
  17. );
  18. }
  19. echo "Completed\n";
  20. ?>
  21. --EXPECT--
  22. Completed