Doc #60464 [Opn->Csd]: fseek documention incorrect

From: Date: Wed, 07 Dec 2011 23:34:12 +0000
Subject: Doc #60464 [Opn->Csd]: fseek documention incorrect
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-7617@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=60464&edit=1 ID: 60464 Updated by: frozenfire@php.net Reported by: df1986 at aol dot com Summary: fseek documention incorrect -Status: Open +Status: Closed Type: Documentation Problem Package: Filesystem function related Operating System: All PHP Version: Irrelevant -Assigned To: +Assigned To: frozenfire Block user comment: N Private report: N New Comment: This bug has been fixed in SVN. 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/. For Windows: http://windows.php.net/snapshots/ Thank you for the report, and for helping us make PHP better. By the way, don't use json_encode for debugging. It's bound to screw you up. Use var_dump instead. Previous Comments: ------------------------------------------------------------------------ [2011-12-07 23:33:32] frozenfire@php.net Automatic comment from SVN on behalf of frozenfire Revision: http://svn.php.net/viewvc/?view=revision&revision=320620 Log: Fixed return value. Closed bug #60464. ------------------------------------------------------------------------ [2011-12-07 22:05:05] df1986 at aol dot com Description: ------------ --- From manual page: http://www.php.net/function.fseek#refsect1-function.fseek-returnvalues --- Docs say fseek returns -1 on error, actually returns false. Test script: --------------- //Invalid resource echo json_encode(fseek('', 52));//outputs false //Dangling resource $f = fopen('somefile', 'r');//to get a valid resource fclose($f);//to make it dangle echo json_encode(fseek($f, 52));//outputs false ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=60464&edit=1

« previous php.doc.bugs (#7617) next »