Luke Jurgs, on 29 October 2011 - 07:26 PM, said:
Sorry, probably not helping here but patient or patient id? You're certain you are interacting with the correct instance member?
I have strict error reporting turned on in my PHP, which means that if I would mistakenly changed variable name, as I think, you suggest, my application would fail to run.
But even so, I've double checked that yes, I'm using exactly the same variable in is_int checking and then displaying it in an exception. I forgot to add that those two double quotes, you see on screenshot are added by me in CException message, so they don't interfere with checked variable type.
Seems that PHP fails to check that variable is a number, raises exception and in that exception message you can see that variable actually is a number. Madness!
Since my first post here, I've changed is_int to is_numeric, but it doesn't change anything. PHP also fails on it. But that isn't something strange, since - if I'm not mistaken - is_numeric($var) = is_int((int)$var).
Luke Jurgs, on 29 October 2011 - 07:26 PM, said:
EDIT: I can't create a condition where you cast to integer using (int) where is_int then fails. I tried casting all sorts of stuff and if (int) finds it isn't an integer it just returns 0. Which is an integer!
AFAIK, is_int (and is_numeric) should return you BOOLEAN, not an integer. And this should be the result of checking, whether your variable is or isn't an integer.