FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Implied cast differs from explicit cast
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Implied cast differs from explicit cast [message #176679 is a reply to message #176669] Tue, 17 January 2012 02:35 Go to previous message
lb is currently offline  lb
Messages: 4
Registered: January 2012
Karma:
Junior Member
Thanks to all who replied, more or less...

I was not trying to convert hex to decimal or any such thing. I was
cleaning up some code that looked something like this:

if (is_numeric($data[$i])) {
$val = (double)$data[$i++];
...
} else {
$i++;
}

I changed it to:
if (is_numeric($val = $data[$i++])) {
...
}

During testing I found that I could get different results within the
block with $val used as a numeric value in calculations. The difference
was when a string containing a hex value was used in the data array.
This is odd behavior, and inconsistant, in my opinion, and might be
considered a PHP bug.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Open Source Development
Next Topic: error from phpadmin
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 28 15:01:00 GMT 2024

Total time taken to generate the page: 0.04638 seconds