1--TEST--
2memory allocation on stream_get_contents()
3--INI--
4memory_limit=32M
5--FILE--
6<?php
7$f = tmpfile();
8fwrite($f, '.');
9
10$chunks = array();
11for ($i = 0; $i < 1000; ++$i) {
12    rewind($f);
13    $chunks[] = stream_get_contents($f, 1000000);
14}
15var_dump(count($chunks));
16?>
17--EXPECT--
18int(1000)
19