You are here: WTF? String = Integer in PHP? Strlen() in integers WORKS? HELP! « PHP Programming Language « IT news, forums, messages
WTF? String = Integer in PHP? Strlen() in integers WORKS? HELP!

Posted by comp.lang.php on 02/03/06 19:03

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация