Annotation of embedaddon/php/ext/standard/tests/streams/bug54946.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Bug#54946 stream_get_contents infinite loop
3: --FILE--
4: <?php
5: $filename = tempnam(__DIR__, "phpbug");
6: $stream = fopen($filename, "w"); // w or a
7: $retval = stream_get_contents($stream, 1, 1);
8: fclose($stream);
9: var_dump($retval);
10: unlink($filename);
11:
12:
13:
14: $filename = tempnam(__DIR__, "phpbug2");
15:
16: $stream = fopen($filename, "a");
17: $retval = stream_get_contents($stream, 1, 1);
18: var_dump($retval);
19: fclose($stream);
20: unlink($filename);
21:
22:
23:
24: $filename = tempnam(__DIR__, "phpbug3");
25:
26: $stream = fopen($filename, "a");
27: fseek($stream, 1);
28: $retval = stream_get_contents($stream, 1);
29: var_dump($retval);
30: fclose($stream);
31: unlink($filename);
32: ?>
33: ===DONE===
34: --EXPECT--
35: string(0) ""
36: string(0) ""
37: string(0) ""
38: ===DONE===
39:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>