stream_enclosed.phpt 456 B

1234567891011121314151617181920
  1. --TEST--
  2. Unexposed/leaked stream encloses another stream
  3. --SKIPIF--
  4. <?php
  5. if (!function_exists('leak_variable')) die("skip only debug builds");
  6. --FILE--
  7. <?php
  8. $s = fopen('php://temp/maxmemory=1024','wb+');
  9. $t = fopen('php://temp/maxmemory=1024','wb+');
  10. /* force conversion of inner stream to STDIO. */
  11. $i = 0;
  12. while ($i++ < 5000) {
  13. fwrite($t, str_repeat('a',1024));
  14. }
  15. leak_variable($s, true);
  16. leak_variable($t, true);
  17. --EXPECT--