I have situation where I have a variable being used in some arithmetic (mostly just multiplication/division) in a PHP function. The variable is actually passed to the function from another. What gets passed, though, may be either a numerical value, or a string value.
So basically I have:
$inverse = 1/$number;
Where $number may be either a valid number, or a string.
My question is what happens when $number is a string? How does php handle that situation?
Ultimately the answer isn't too important; I can think of a couple of different ways of working around the situation. It's just that it came up, I got curious, and a quick google search couldn't answer my question. Even if I don't need to know the answer, I'd like to know the answer, because understanding how PHP works will help me in the future.
Thanks.