php-src/ext/standard/tests/streams/bug46426.phpt

35 lines
529 B
Plaintext
Raw Normal View History

--TEST--
Bug #46426 (3rd parameter offset of stream_get_contents not works for "0")
--FILE--
<?php
$tmp = tmpfile();
2009-04-25 21:13:07 +00:00
fwrite($tmp, b"12345");
2008-10-30 14:34:25 +00:00
echo stream_get_contents($tmp, 2, 1);
echo "\n";
echo stream_get_contents($tmp, -1);
echo "\n";
2008-10-30 14:34:25 +00:00
echo stream_get_contents($tmp, -1, 0);
echo "\n";
echo stream_get_contents($tmp, -1, 2);
2008-10-30 14:34:25 +00:00
echo "\n";
echo stream_get_contents($tmp, 0, 0);
echo "\n";
echo stream_get_contents($tmp, 1, 0);
echo "\n";
echo stream_get_contents($tmp, -1);
@unlink($tmp);
?>
--EXPECT--
2008-10-30 14:34:25 +00:00
23
45
12345
345
2008-10-30 14:34:25 +00:00
1
2345