Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:26550 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 87026 invoked by uid 1010); 14 Nov 2006 08:24:18 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 87011 invoked from network); 14 Nov 2006 08:24:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Nov 2006 08:24:18 -0000 Authentication-Results: pb1.pair.com smtp.mail=rquadling@googlemail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rquadling@googlemail.com; sender-id=pass; domainkeys=good Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 64.233.166.177 as permitted sender) DomainKey-Status: good X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: rquadling@googlemail.com X-Host-Fingerprint: 64.233.166.177 py-out-1112.google.com Linux 2.4/2.6 Received: from [64.233.166.177] ([64.233.166.177:52649] helo=py-out-1112.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 97/05-50866-03D79554 for ; Tue, 14 Nov 2006 03:24:17 -0500 Received: by py-out-1112.google.com with SMTP id u77so1001329pyb for ; Tue, 14 Nov 2006 00:24:14 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=googlemail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Iztkjw9tC5DnR8v996o5O7LgeQwvX6um8jIPbZwHpR48EZ0V5UopOcpOTRisvqtN7T6q7IHWOzOQifLvqSAl0E+HjePDHHGFvlKrBkmIN8CmEfKFM7MiST4CDL+JkxizEv+jhtaFTZlyiVTo5kkYOonTdt0/gUxUGYC1Q2PIFzQ= Received: by 10.35.79.3 with SMTP id g3mr552430pyl.1163492653810; Tue, 14 Nov 2006 00:24:13 -0800 (PST) Received: by 10.35.97.14 with HTTP; Tue, 14 Nov 2006 00:24:13 -0800 (PST) Message-ID: <10845a340611140024l4902ea09q600a43c5018e819c@mail.gmail.com> Date: Tue, 14 Nov 2006 08:24:13 +0000 Reply-To: RQuadling@GoogleMail.com To: "Antony Dovgal" Cc: php-dev In-Reply-To: <4558E5E7.5040809@zend.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <4558E5E7.5040809@zend.com> Subject: Re: [PHP-DEV] fgets()/fgetss() BC break in HEAD From: rquadling@googlemail.com ("Richard Quadling") As we are often told on this list, PHP is not C. It seems utterly ridiculous to return maxlen-1. Whilst this is sure as hell a BC, it should work "properly". If I ask for 10, I want 10. I wouldn't have asked for 10 otherwise. Having to know the "magic" to get things to work is plainly bad magic. In terms of KISS, 10 means 10. Unless PHP !== KISS therefore 10 === 9. Make the break. Deal with it. It was wrong and now it is fixed. On 13/11/06, Antony Dovgal wrote: > Hello all. > > I'd like to continue recent IRC discussion here, to draw more attention to this issue. > > At the moment functions fgets() and fgetss() are broken in HEAD, as they return > characters instead of , as they do in 5.2 (and I'm pretty sure this is the way > they used to work since their very first appearance in PHP). > So, anybody relying on fgets($fp, 10) to return 9 characters would get 10 characters instead. > > Yes, this behaviour is not very intuitive for those who are not familiar with fgets() in C, > but it's well documented and pretty much expected. > > I believe this is an unreasonable BC break and I strongly believe it should be fixed. > There are 0 reasons to do it (without any discussion) and it can only result in more users' confusion, > even if the original purpose was the contrary. > > -- > Wbr, > Antony Dovgal > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- ----- Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731 "Standing on the shoulders of some very clever giants!"