1
0
mirror of https://github.com/php/php-src.git synced 2026-04-28 18:53:33 +02:00
Files
archived-php-src/ext/standard/tests/streams/bug78326.phpt
T
Albert Casademont dc7aa22b18 Fix bug #78326
Similar to what fread() does, truncate the stream_get_contents()
result if the original buffer was way too large.
2019-07-29 17:33:57 +02:00

19 lines
295 B
PHP

--TEST--
memory allocation on stream_get_contents()
--INI--
memory_limit=32M
--FILE--
<?php
$f = tmpfile();
fwrite($f, '.');
$chunks = array();
for ($i = 0; $i < 1000; ++$i) {
rewind($f);
$chunks[] = stream_get_contents($f, 1000000);
}
var_dump(count($chunks));
?>
--EXPECT--
int(1000)