title: Strange PHP bug
body: <p>When setting a value for an index using a formula to calculate the index, something like 
  <code>$arr[((40.9+0.00004)*100000)] = 1;</code>,
  in the expected result my array should have the value for index as so: <code>[4090004]=&gt;1</code>;
  instead I got  <code>[4090003]=&gt;1</code>.</p>
  
  <p>Can someone please give me an insight into what's going on?</p>
  
  <p>I was able to get around this by casting the index to a string <code>$arr[(string) ((40.9+0.0004)*100000)] = 1;</code>, but I would like to understand the underlying mechanics that caused this to happen.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>This is not directly connected to this question <a href="https://stackoverflow.com/questions/588004/is-floating-point-math-broken">Is floating point math broken?</a> — while the answer might have to do with that floating point bug, I am trying to understand how it effects me here.</p>