3 ms·
>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 s
by babyrainbow 10y ago
>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...
- Chyzwar 10y agoYes, 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.
- developer2 10y agoIt 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.