Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:20851 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 18108 invoked by uid 1010); 29 Nov 2005 17:47:08 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 18093 invoked from network); 29 Nov 2005 17:47:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Nov 2005 17:47:08 -0000 X-Host-Fingerprint: 67.154.202.210 ip67-154-202-210.z202-154-67.customer.algx.net Received: from ([67.154.202.210:7515] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 7A/9B-14828-B149C834 for ; Tue, 29 Nov 2005 12:47:07 -0500 To: internals@lists.php.net Date: Tue, 29 Nov 2005 12:47:02 -0500 Reply-To: ben.litton@gmail.com References: <438C7A4C.9090503@fission.org.uk> <8E.A3.14828.D718C834@pb1.pair.com> <438C8E07.7050206@fission.org.uk> <438C91AC.5050305@beccati.com> <438C92F2.4010802@fission.org.uk> Organization: BioInformatics Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-15 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID: User-Agent: Opera M2/8.51 (MacPPC, build 2182) X-Posted-By: 67.154.202.210 Subject: Re: [PHP-DEV] Re: is_int/is_numeric possible bug From: ben.litton@gmail.com ("Ben Litton") is_numeric will test if it's a numeric string. Maybe is_int should do the same, but apparently it doesn't. You could always do an is_numeric and if it returns true, cast it as an int. On Tue, 29 Nov 2005 12:42:10 -0500, Gareth Ardron wrote: > Matteo Beccati wrote: >> Gareth Ardron wrote: >> >>> Ron Korving wrote: >>> >>>> Just out of curiosity, to which versions does this apply? >>> >>> >>> 5.1.0b3->5.1.1 at least. Haven't got anything older to test on. >> As far as I know request variables have always been strings, and >> is_int() checks the variable type, not its content. >> I wonder how your code was previously working ;) > > It wasn't, I was just helping a mate do something. New code. > > But still, it seems very odd to me - I mean, why does is_numeric() > therefore work when is_int() doesn't - that seems like strange logic to > me (though I admit I'm not the most logical of people). > > I just don't see the need to have to do: > > if (is_numeric($_REQUEST['var']) && is_int($_REQUEST['var'])) { > > when, at least in my mind, is_int() should do the job by itself. -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/