Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76247 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 84822 invoked from network); 29 Jul 2014 07:06:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Jul 2014 07:06:19 -0000 Authentication-Results: pb1.pair.com smtp.mail=tjerk.meesters@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=tjerk.meesters@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.179 as permitted sender) X-PHP-List-Original-Sender: tjerk.meesters@gmail.com X-Host-Fingerprint: 74.125.82.179 mail-we0-f179.google.com Received: from [74.125.82.179] ([74.125.82.179:54681] helo=mail-we0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0B/C6-41808-AE747D35 for ; Tue, 29 Jul 2014 03:06:19 -0400 Received: by mail-we0-f179.google.com with SMTP id u57so8466592wes.10 for ; Tue, 29 Jul 2014 00:06:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=wL91APn9m2lE7SgfY7wgnwnp53p/bAOL/be46cP09lA=; b=A04iCaVQiALUhnHOutGhBqj3o03r91Sg1EF3MsFZZHvAf2A/qtTLoilNlN/enMUIsG KDWqKPK0H8uOxooikL5QRuiZvKV4zZtI1Aw+rtmBmj9e3oX89O8A2Um3w8rUAyxuDiph xiu3pa0w2bfMnvDWrEy2PuBp7m5Zp166zwGN+Euezimy0JaJwRA+SfhvuX4UtKfpcX7u r7ihttci90JBOReQZpbCNU1tlOSHR3vejHi8soJ3oZidO27NmCajo9mb4exagqabrmK9 36ezCQx295GdEpy+xnsUtpEzj6twkfSavq4HAwaxcma2mYnyrrITlUdKNTPxZYBNrVkN axMw== MIME-Version: 1.0 X-Received: by 10.180.218.72 with SMTP id pe8mr39194948wic.63.1406617590037; Tue, 29 Jul 2014 00:06:30 -0700 (PDT) Received: by 10.180.77.68 with HTTP; Tue, 29 Jul 2014 00:06:29 -0700 (PDT) In-Reply-To: References: Date: Tue, 29 Jul 2014 15:06:29 +0800 Message-ID: To: Maciej Sobaczewski Cc: PHP Internals Content-Type: multipart/alternative; boundary=001a1134c5ceca04aa04ff4fad18 Subject: Re: [PHP-DEV] Is fgetss() useless? From: tjerk.meesters@gmail.com (Tjerk Meesters) --001a1134c5ceca04aa04ff4fad18 Content-Type: text/plain; charset=UTF-8 Hi Maciej, On Mon, Jul 28, 2014 at 7:21 PM, Maciej Sobaczewski wrote: > Hello guys, > > so... fgetss(). We have such a beautiful function in PHP. As it's > described in the manual: "Get line from file pointer and strip HTML tags". > I'm wondering if it has any differences/advantages over using just > strip_tags(fgets($stream)). > The `fgetss()` function keeps the strip_tags state between reads to provide consistent results; observe the following example: hello world This should rightfully output only "hello world" (and some newlines); if you would apply `strip_tags()` on each individually read line, you would also get stuff you don't want. > I'm going to write an RFC proposing deprecation and then removal of it, > but first I want to ensure that this function is as useless (IMHO) as I > think. > > Best regards, > Maciej. > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- -- Tjerk --001a1134c5ceca04aa04ff4fad18--