I have a problem baffling me terribly. I noticed this before but didn\'t give it any heed until today.
I was trying to write my own check for integer strings. I know of
You made an error with your post, the correct output is this:
bool(true)
bool(true)
int(0)
string(6) "string"
What happens is this:
==, PHP will first implicitely cast the string to an integer, a more explicit but 100% equivalent form would be: if((int)$var1 == (int) $var1)int(0), as it should, because it fails to parse the number, it will return 0 instead.string(6) "string" - as expected