I’m a bit stumped on this equal operator.
echo (2 == “2.5time”)
should output to 1/true.
The “2.5time” string should typecast into an integer and output 2 as an integer.
But it doesn’t seem to output anything.
Can anyone explain?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The comparison is having PHP parse the string and get a number of 2.5 which is a float. it’s then comparing it against your integer which gets treated as a float 2.0