Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:20857 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 29823 invoked by uid 1010); 29 Nov 2005 17:59:30 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 29808 invoked from network); 29 Nov 2005 17:59:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Nov 2005 17:59:30 -0000 X-Host-Fingerprint: 64.233.162.202 zproxy.gmail.com Linux 2.4/2.6 Received: from ([64.233.162.202:25944] helo=zproxy.gmail.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 21/8D-14828-2079C834 for ; Tue, 29 Nov 2005 12:59:30 -0500 Received: by zproxy.gmail.com with SMTP id q3so184731nzb for ; Tue, 29 Nov 2005 09:59:26 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:user-agent:x-accept-language:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; b=dplO7ORgI555TZUfg58uTScYu98Vh0f+1tqkKUgM8HfET34xTl1PMfOOeV22yd5Qj4yG+Kzao6tioiUOTQ298r+J6bHN4KpWo8ywhZL68k4GB7+geFVnoyFSr0YzeJILuhYB//YoEPg5/LZw/2NdDHe4ZPFONYS/smO3o0W25bs= Received: by 10.65.177.9 with SMTP id e9mr9215025qbp; Tue, 29 Nov 2005 09:59:26 -0800 (PST) Received: from ?192.168.1.16? ( [84.132.138.154]) by mx.gmail.com with ESMTP id d5sm601258qbd.2005.11.29.09.59.24; Tue, 29 Nov 2005 09:59:26 -0800 (PST) Message-ID: <438C96FD.6070009@gmail.com> Date: Tue, 29 Nov 2005 18:59:25 +0100 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050923 Thunderbird/1.0.7 Mnenhy/0.7.2.0 X-Accept-Language: en-us, en MIME-Version: 1.0 To: ben.litton@gmail.com CC: internals@lists.php.net 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> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: is_int/is_numeric possible bug From: bgrupe@gmail.com (Bastian Grupe) Ben Litton wrote: > > You could always do an is_numeric and if it returns true, cast it as an > int. That is the way it's meant to be done. is_int() really checks for the dataTYPE and not the CONTENTS (of course the contents depend on the type, e.g. in an int you won't find a string). giving is_numeric() and the ctype functions strings as argument actually check for the CONTENTS (in different ways). is_int(1) => true is_int("1") => false is_numeric(1) => true is_numeric("1") => true I hope now everything is clear for everybody. Regards, B. Grupe P.S.: I think the general/help lists are more appropriate for these kind of problems before asking internals. P.P.S.: Sorry for potential spam, but I thought it is necessary to clear it up once and for all.