Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:9621 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 22786 invoked by uid 1010); 30 Apr 2004 20:29:28 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 22604 invoked from network); 30 Apr 2004 20:29:25 -0000 Received: from unknown (HELO mail.zend.com) (192.117.235.230) by pb1.pair.com with SMTP; 30 Apr 2004 20:29:25 -0000 Received: (qmail 27728 invoked from network); 30 Apr 2004 20:29:20 -0000 Received: from guardian.zend.office (HELO zeev-laptop-new.zend.com) (10.1.1.4) by int.zend.com with SMTP; 30 Apr 2004 20:29:20 -0000 Reply-To: zeev@zend.com Message-ID: <5.1.0.14.2.20040430232610.03e7b0e0@localhost> X-Sender: zeev@localhost X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Fri, 30 Apr 2004 23:29:19 +0300 To: Derick Rethans Cc: PHP Developers Mailing List In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Subject: Re: [PHP-DEV] fread($fp, 0); From: zeev@zend.com (Zeev Suraski) References: The CVS update read: Fixed bug #26752 (Silent unterminated loop when length parameter for fgets(), fread() and fgetss() is 0). (done by Ilia January 2nd this year) I tend to agree that this was a bad idea, and suggest to restore the old check. Unless I'm missing something, bug #26752 wasn't a bug in PHP but in the reporter's code. Zeev At 23:18 30/04/2004, Derick Rethans wrote: >Hello, > >what was the rationale behind throwing a warning for the snippet in the >topic? > >Warning: fread(): Length parameter must be greater than 0. in > /usr/local/lib/php/PEAR/Common.php on line 1296 > >This breaks often used code where the filesize is 0, like: > $f = fopen('file', 'r'); > $contents = fread($f, filesize('file')); > >And I don't really see the point of throwing a warning here. > >Derick > >-- >PHP Internals - PHP Runtime Development Mailing List >To unsubscribe, visit: http://www.php.net/unsub.php