Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:65634 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 22798 invoked from network); 4 Feb 2013 13:27:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Feb 2013 13:27:12 -0000 Authentication-Results: pb1.pair.com smtp.mail=frank.liepert@gmx.de; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=Frank.Liepert@gmx.de; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmx.de designates 212.227.17.21 as permitted sender) X-PHP-List-Original-Sender: frank.liepert@gmx.de X-Host-Fingerprint: 212.227.17.21 mout.gmx.net Received: from [212.227.17.21] ([212.227.17.21:65117] helo=mout.gmx.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id ED/B7-14611-A27BF015 for ; Mon, 04 Feb 2013 08:27:07 -0500 Received: from mailout-de.gmx.net ([10.1.76.35]) by mrigmx.server.lan (mrigmx002) with ESMTP (Nemesis) id 0MQ9FN-1U5uRo2ayB-005JX1 for ; Mon, 04 Feb 2013 14:27:03 +0100 Received: (qmail invoked by alias); 04 Feb 2013 13:27:03 -0000 Received: from p549B20BF.dip.t-dialin.net (EHLO FrankNotebook) [84.155.32.191] by mail.gmx.net (mp035) with SMTP; 04 Feb 2013 14:27:03 +0100 X-Authenticated: #18131098 X-Provags-ID: V01U2FsdGVkX1+sp5BKckqsb8EmIHqpsxiu2N7F9kRhdL3eoJpVzX b5SSokNhFtVo1h To: "'Gustavo Lopes'" , "'Patrick Schaaf'" , Cc: "'Derick Rethans'" , "'Martin Jansen'" References: <510EA95F.40503@divbyzero.net> <2835262.zO39iNXCyM@rofl> <002d01ce02c8$dbb6d430$93247c90$@Liepert@gmx.de> In-Reply-To: Date: Mon, 4 Feb 2013 14:27:01 +0100 Message-ID: <003401ce02db$53073e00$f915ba00$@Liepert@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Ac4Cy29YGVAzNLdIS3apFBGAj8P41AAD9PzQ Content-Language: de X-Y-GMX-Trusted: 0 Subject: AW: AW: [PHP-DEV] FILTER_VALIDATE_INT and +0/-0 From: Frank.Liepert@gmx.de ("Frank Liepert") > So the question is only whether "+0" or "-0" (or "+0", etc.) should be > accepted as integers by FILTER_VALIDATE_INT. I think they should, > because > we also accept non-canonical inputs such as "+5", i.e., we always > accept a > sign. It's true that 0 is neither positive or negative, but I don't > think > "accepts a leading sign, except if it's 0" is a good option. It's an > unnecessary special case. I was misguided by two statements, I'm sorry. The 1st: In my opinion FILTER_VALIDATE_INT must work like var_dump(-0); = (BR #54096) The 2nd: "Treat "+0" and "-0" as valid integers just like var_dump() = does." (https://github.com/php/php-src/pull/248) Both statements are wrong, since the purpose of the filter extension is = to validate strings. I found this information in BR #52884 (see last = comment). Maybe it should be added to the docs? It's nonsense to say, = that FILTER_VALIDATE_INT must work like var_dump() since they are both = serving different purposes. With this information I agree on your opinion. var_dump(filter_var('-0',FILTER_VALIDATE_INT)); // int(0) instead of the = prior bool(false) var_dump('-0'); // string(2) "-0" var_dump(is_int('-0')); // bool(false)