Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76248 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 86451 invoked from network); 29 Jul 2014 07:10:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Jul 2014 07:10:24 -0000 X-Host-Fingerprint: 178.235.226.57 178235226057.olsztyn.vectranet.pl Received: from [178.235.226.57] ([178.235.226.57:21170] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F0/27-41808-FD847D35 for ; Tue, 29 Jul 2014 03:10:24 -0400 Message-ID: To: internals@lists.php.net Date: Tue, 29 Jul 2014 09:10:38 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 140728-2, 2014-07-28), Outbound message X-Antivirus-Status: Clean X-Posted-By: 178.235.226.57 Subject: Re: [PHP-DEV] Is fgetss() useless? From: sobak@php.net (Maciej Sobaczewski) Hello Tjerk, thanks for the explanation. This is close to what I thought. So, if there is a difference, I see no point in proposing to remove it. You can consider this thread as closed ;) Have a nice day, Maciej. > 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 > echo "we don't want this;" > ?> > 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 >> >> > >