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