Re: [RFC] Strict type hints (parameter and return value)
| From: | Sam Barrow | Date: | Thu, 17 Apr 2008 17:23:46 +0000 |
| Subject: | Re: [RFC] Strict type hints (parameter and return value) | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-37095@lists.php.net to get a copy of this message | ||
On Thu, 2008-04-17 at 10:23 -0700, Chris Stockton wrote:
> On Thu, Apr 17, 2008 at 10:11 AM, Sam Barrow <sam@sambarrow.com>
> wrote:
> Actually, is_numeric checks for strings that contain numeric
> values,
> it's not the same as is_bool, is_int, is_float, etc, which
> check the
> variable's type.
> Hence my second example = )
>
>
> Your point is very valid for is_int and similar functions,
> just not
> is_numeric(). I just did a grep on zend framework for is_int
> and there
> were tons of results.
> I think it is valid for anything, numeric type hinting is very
> appropriate in php.
Numeric type hinting is valid, all I'm saying is that PHP's is_numeric
function doesn't perform a strict type check like is_int or is_bool. I
agree with you I just think you misunderstood the purpose of the
is_numeric function.