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?

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to