|
Posted by d on 02/03/06 19:08
"comp.lang.php" <phillip.s.powell@gmail.com> wrote in message
news:1138986214.291779.125980@g49g2000cwa.googlegroups.com...
> I'm involved in a rather nasty debate involving a strange issue
> (whereby the exasperated tell me to RTFM even after my having done so),
> where this is insanely possible:
>
> [PHP]
> print_r(is_int('1')); // PRINTS NOTHING
> print_r(strlen((int)1)); // PRINTS '1'
> [/PHP]
>
> Now I understand that in PHP, everything scalar is a string and can
> take on the role of an integer, or a boolean or.. whatever it's
> configured to look like. Why is it that I'm so "way off" in this
> thread, when it seems to me that I have it right based on my basic
> understanding the definition of "types"?
>
> Phil
>
> http://phpbuilder.com/board/showthread.php?t=10316949
>
If you try that with var_dump, you get a false and a 1, which is what you'd
expect... Am I missing something here?? :)
Navigation:
[Reply to this message]
|