Annotation of embedaddon/php/ext/standard/tests/streams/bug48309.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #48309 (stream_copy_to_stream() and fpasstru() do not update stream position)
! 3: --FILE--
! 4: <?php
! 5:
! 6: $tmp = tmpfile();
! 7: fwrite($tmp, b'test');
! 8: fseek($tmp, 0, SEEK_SET);
! 9:
! 10: echo "-- stream_copy_to_stream() --\n";
! 11:
! 12: fseek($tmp, 0, SEEK_SET);
! 13: stream_copy_to_stream($tmp, STDOUT, 2);
! 14:
! 15: echo "\n";
! 16: var_dump(stream_get_contents($tmp));
! 17:
! 18: echo "-- fpassthru() --\n";
! 19:
! 20: fseek($tmp, 0, SEEK_SET);
! 21: fpassthru($tmp);
! 22:
! 23: echo "\n";
! 24: var_dump(stream_get_contents($tmp));
! 25:
! 26: ?>
! 27: --EXPECTF--
! 28: -- stream_copy_to_stream() --
! 29: te
! 30: string(2) "st"
! 31: -- fpassthru() --
! 32: test
! 33: string(0) ""
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>