Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:20859 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 44316 invoked by uid 1010); 29 Nov 2005 18:33:38 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 44301 invoked from network); 29 Nov 2005 18:33:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Nov 2005 18:33:38 -0000 X-Host-Fingerprint: 69.231.217.122 adsl-69-231-217-122.dsl.irvnca.pacbell.net Received: from ([69.231.217.122:8914] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id C8/0F-14828-00F9C834 for ; Tue, 29 Nov 2005 13:33:36 -0500 Message-ID: To: internals@lists.php.net Date: Tue, 29 Nov 2005 10:33:37 -0800 User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050929) X-Accept-Language: en-us, en MIME-Version: 1.0 References: <438C7A4C.9090503@fission.org.uk> <438C853D.8050608@zend.com> <438C8E5E.5030907@fission.org.uk> <438C8F54.9010001@zend.com> <438C91CE.6070608@fission.org.uk> In-Reply-To: <438C91CE.6070608@fission.org.uk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 69.231.217.122 Subject: Re: [PHP-DEV] is_int/is_numeric possible bug From: unknown@simplemachines.org ("Unknown W. Brackets") If you're having that problem that a request variable is being reported as an integer, I suggest using var_dump(). That function will tell you the type and contents of a variable. For example: $bool = true; $int = 1; $float = 1.0; $str = 'abc'; $array = array(); var_dump($bool, $int, $float, $str, $array); Will give you: bool(true) int(1) float(1) string(3) "abc" array(0) { } All of the above are very different. A request variable should always be of type string, and if one is not then I suspect that may indeed be a bug. Remember that PHP doesn't hide the type from you, it just simplifies conversions and usage for you. In any case, if you want it to be 10 if it wasn't set to a valid int, I think you want: $_REQUEST['days'] = is_numeric($_REQUEST['days']) ? (int) $_REQUEST['days'] : 10; Or similar. Note that this will treat "5.1" as 5, not as 10 (which may be what you want.) -[Unknown] -------- Original Message -------- > Antony Dovgal wrote: > >> >> And PHP from .deb too? >> *That* could be a problem. >> > God no, If I was doing that, I wouldn't report the bug here :) > > Can give you the configure line if it'll help?