Annotation of embedaddon/php/ext/standard/tests/streams/stream_get_line_NUL_delimiter.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Bug #60455: stream_get_line and \0 as a delimiter
3: --FILE--
4: <?php
5: class TestStream {
6: private $s = 0;
7: function stream_open($path, $mode, $options, &$opened_path) {
8: return true;
9: }
10: function stream_read($count) {
11: if ($this->s++ == 0)
12: return "a\0";
13:
14: return "";
15: }
16: function stream_eof() {
17: return $this->s >= 2;
18: }
19:
20: }
21:
22: stream_wrapper_register("test", "TestStream");
23:
24: $f = fopen("test://", "r");
25: var_dump(stream_get_line($f, 100, "\0"));
26: --EXPECT--
27: string(1) "a"
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>