xref: /PHP-7.4/ext/standard/tests/file/bug44607.phpt (revision c7167ced)
1--TEST--
2Bug #44607 (stream_get_line unable to correctly identify the "ending" in the stream content)
3--FILE--
4<?php
5$eol = '<EOL>';
6$tempnam = __DIR__ . '/' . 'tmpbug44607.txt';
7$data = str_repeat('.', 14000);
8$data .= $eol;
9$data .= $data;
10file_put_contents($tempnam, $data);
11$fd = fopen($tempnam, 'r');
12var_dump(strlen(stream_get_line($fd, 15000, $eol)));
13var_dump(strlen(stream_get_line($fd, 15000, $eol)));
14fseek($fd, 1, SEEK_SET);
15var_dump(strlen(stream_get_line($fd, 15000, $eol)));
16var_dump(strlen(stream_get_line($fd, 15000, $eol)));
17fclose($fd);
18unlink($tempnam);
19?>
20--EXPECT--
21int(14000)
22int(14000)
23int(13999)
24int(14000)
25