Hi!
as this seems to be your only argument throughout the discussion, I
suggest we implement is_numeric() and alike or allow a second parameter
that to 'is_*($vaue, $strict=true)' that allows to switch to non strict
mocde. We then could easily allow 'numeric' as another type hint. Or in
I see absolutely no use in "strict" mode. Moreover, I consider it
harmful as it teaches people not to use dynamic nature of PHP but
instead pepper their code with unnecessary checks and irrelevant errors.
As I said, I see no difference that could matter to PHP programmer
between '1' and 1, and I don't see why we should encourage making this
difference.
I know there could be very special cases when it could matter, but
importance and frequency of such cases do not warrant, in my opinion,
their support by the syntax and the standard library of the language.
other words I see this as a completely separate discussion. There are
two discussions:
a) do we want native type hints
b) do we want an easy ability to deal with compatible types in type hinting
Just for the record:
a) I think the whole idea of type hints, especially with primitive
types, goes to a wrong direction - PHP is not a strictly typed language,
and shouldn't be.
b) However, on practical grounds, since we already have type conversion
for internal functions, it won't be too much trouble for a user
functions to do the same. On the other hand, making strict types for PHP
functions is nothing but trouble, IMO.
This is why I think it is not as separate as you think.
--
Stanislav Malyshev, Zend Software Architect
[EMAIL PROTECTED] http://www.zend.com/
(408)253-8829 MSN: [EMAIL PROTECTED]
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php