mirror of
https://github.com/php/php-src.git
synced 2024-10-01 06:46:08 +00:00
3943351e6a
fix the erratic behavior without breaking backwards compatibility. Namely, $offset retains SEEK_SET behavior but actually SEEK_CUR is passed to _php_stream_seek, if possible, by moving the offset stream->position bytes. - Addresses bug #53006.
23 lines
348 B
PHP
23 lines
348 B
PHP
--TEST--
|
|
stream_get_contents() - Testing offset out of range
|
|
--FILE--
|
|
<?php
|
|
|
|
$tmp = tmpfile();
|
|
|
|
fwrite($tmp, b"12345");
|
|
|
|
echo stream_get_contents($tmp, 2, 5), "--\n";
|
|
echo stream_get_contents($tmp, 2), "--\n";
|
|
echo stream_get_contents($tmp, 2, 3), "--\n";
|
|
echo stream_get_contents($tmp, 2, -1), "--\n";
|
|
|
|
@unlink($tmp);
|
|
|
|
?>
|
|
--EXPECT--
|
|
--
|
|
--
|
|
45--
|
|
--
|