Re: docu of fread function

From: Date: Thu, 31 May 2007 18:00:05 +0000
Subject: Re: docu of fread function
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969376489@lists.php.net to get a copy of this message
Hi Giunta On 5/28/07, Gaetano Giunta <giunta.gaetano@gmail.com> wrote:
Hello there. The online manual for fread states clearly "Returns the read string or FALSE in case of error." I was always puzzled by that assertion, and today decided to digg into the code. As a matter of fact, the only time fread returns FALSE (on php 5) is when it is invoked whith a negative $length, or with a single parameter.
In PHP4.4 and 5.2 (didn't check HEAD) fread() will return false (and a warning thrown) if the resource argument isn't a stream resource and if the the second argument (length) is 0 or less. NULL will be returned (and warning thrown) if fread() doesn't get passed two arguments (like most other functions).
Maybe an update would be appropriate?
I don't see anything wrong with them.. But if you have any suggestions the least we could do is hear them out. -Hannes

« previous php.doc (#969376489) next »