Annotation of embedaddon/php/ext/standard/tests/file/bug43522.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #43522 (stream_get_line() eats additional characters)
! 3: --FILE--
! 4: <?php // 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ
! 5:
! 6: $fp = fopen(__FILE__, 'r'); // Open self
! 7:
! 8: DoTest($fp, 'ZZZ'); // test multi-char delimiter
! 9: DoTest($fp, "Z"); // test single-char delimiter
! 10:
! 11: function DoTest($fp, $delim) {
! 12: echo "Delimiter: " . $delim . "\n";
! 13: rewind($fp);
! 14: echo "\t" . stream_get_line($fp, 10, $delim) . "\n";
! 15: echo "\t" . stream_get_line($fp, 10, $delim) . "\n";
! 16: }
! 17:
! 18: ?>
! 19: --EXPECT--
! 20: Delimiter: ZZZ
! 21: <?php // 1
! 22: 234567890A
! 23: Delimiter: Z
! 24: <?php // 1
! 25: 234567890A
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>