News for hackers. Stuff that matters.
Re:The trouble with 'floor' and 'ceil' by donatj on Thursday January 07, 2016 @01:21AM (#10856333)
I had some very similar, very troubling PHP code.

  var_export($var) // 18
  json_encode($var) // 18
  serialize($var) // 18i:18;
  var_export($var == 18) // false
  var_export(floor($var)) // 17
Ends up PHP floats have a configurable precision and an actual physical 32/62 bit (depending on the system) in memory value who are separate and some operations use one and some the other. It was particularly troubling because I'd hope to be able to serialize and unserialize numbers losslessly but that was not the case.
Re:The trouble with 'floor' and 'ceil' by lsaferite on Thursday January 07, 2016 @08:59AM (#10857904)
Can you provide a working 3v4l.org example of this issue? I'm very interested is what triggered it to not output the correct values for json_encode and serialize.