ID: 46426
Updated by: [EMAIL PROTECTED]
Reported By: zhustar at gmail dot com
-Status: Open
+Status: Assigned
Bug Type: Filesystem function related
Operating System: Linux
PHP Version: 5.2.6
-Assigned To:
+Assigned To: felipe
Previous Comments:
------------------------------------------------------------------------
[2008-10-30 08:15:01] zhustar at gmail dot com
Description:
------------
php 5.2.0
I want get the string from begin to the end ("12345")
but return empty when set offset to 0
Reproduce code:
---------------
<?PHP
$tmp = tmpfile();
fwrite($tmp, "12345");
//rewind($tmp);
echo "---\n";
echo stream_get_contents($tmp, -1, 0);
echo "\n";
echo stream_get_contents($tmp, -1, 1);
echo "\n";
echo stream_get_contents($tmp, -1, 2);
echo "\n---";
?>
Expected result:
----------------
---
12345
2345
345
---
Actual result:
--------------
---
2345
345
---
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=46426&edit=1