Hacker News new | past | comments | ask | show | jobs | submit login

>try passing integer values. ctype_digit(50) === true, but ctype_digit(100) === false.

That is hilarious! I love how even stuff that is supposed to fix other stuff itself end up being completely broken. But hey, it is documented.

Learning Php is like taking a massive loan. It get you started easily, but causes eternal suffering in the long run...




It is in fact documented; what I didn't explain is that ctype_digit treats integers < 127 as chr() equivalents. It's designed to juggle both strings and integers, which indeed works against php's usual method of type juggling. This is because ctype is a port or wrapper around the C lib which behaves as such.


Yes, The worst part is that it will make you worse developer. It is like drinking a lot of soft drinks, side-effects will kill you.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: