Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78251 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 9427 invoked from network); 22 Oct 2014 21:41:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Oct 2014 21:41:57 -0000 Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 192.64.116.208 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.208 imap2-3.ox.privateemail.com Received: from [192.64.116.208] ([192.64.116.208:51022] helo=imap2-3.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B8/D7-63701-4A428445 for ; Wed, 22 Oct 2014 17:41:57 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 456C48C0082; Wed, 22 Oct 2014 17:41:54 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at imap2.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap2.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id MD0ZIs6CN4h0; Wed, 22 Oct 2014 17:41:54 -0400 (EDT) Received: from oa-res-26-28.wireless.abdn.ac.uk (oa-res-26-28.wireless.abdn.ac.uk [137.50.26.28]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 246518C007B; Wed, 22 Oct 2014 17:41:52 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) In-Reply-To: <54482236.8030408@sugarcrm.com> Date: Wed, 22 Oct 2014 22:41:51 +0100 Cc: Zeev Suraski , Dmitry Stogov , PHP Internals Content-Transfer-Encoding: quoted-printable Message-ID: References: <66B7B28C-2651-4A71-AC2A-55D4C7BB3DDC@ajf.me> <866A39C7-6F11-408D-8BCA-594BA22E8569@ajf.me> <5447682B.2080100@sugarcrm.com> <019325A5-4F82-4179-B4D7-29E5649B2616@ajf.me> <54480580.9040302@sugarcrm.com> <4F848DB0-0266-46A0-9805-2B2BF22CAC33@ajf.me> <54480F68.6010406@sugarcrm.com> <058059C3-514C-4EA9-9468-3B9A8F20DCA8@ajf.me> <54482236.8030408@sugarcrm.com> To: Stas Malyshev X-Mailer: Apple Mail (2.1990.1) Subject: Re: [PHP-DEV] [RFC] Safe Casting Functions From: ajf@ajf.me (Andrea Faulds) > On 22 Oct 2014, at 22:31, Stas Malyshev = wrote: >=20 > Hi! >=20 >> Are you opposed to the existence of ext/filter given it has >> FILTER_VALIDATE_INT, a =E2=80=9Cprimitive for handling type = conversions=E2=80=9D? >=20 > FILTER_VALIDATE_INT is an option for a filter_var function, and it is > not introducing any new rules for handling types in the engine. Nor is this. > What you are proposing is not like FILTER_VALIDATE_INT, it's like = (int). I don=E2=80=99t see the difference: $x =3D filter_var(FILTER_VALIDATE_INT, $foo); $x =3D to_int($foo); They=E2=80=99re very similar, except the latter has slightly different = rules, is shorter, and if some people (possibly me) get their way, might = throw an exception. -- Andrea Faulds http://ajf.me/