#46426 [Tbd->Bgs]: 3rd parameter offset of stream_get_contents not works for "0"

From: Date: Wed, 17 Feb 2010 00:23:42 +0000
Subject: #46426 [Tbd->Bgs]: 3rd parameter offset of stream_get_contents not works for "0"
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-147732@lists.php.net to get a copy of this message
ID: 46426 Updated by: joey@php.net Reported By: zhustar at gmail dot com -Status: To be documented +Status: Bogus Bug Type: Filesystem function related Operating System: Linux PHP Version: 5.2.6 New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Nothing to document here. Previous Comments: ------------------------------------------------------------------------ [2008-10-30 10:13:19] felipe@php.net This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. We need add a note in the documentation. ------------------------------------------------------------------------ [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

« previous php.bugs (#147732) next »