|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2011-05-18 19:39 UTC] rasmus@php.net
 
-Status: Open
+Status: Bogus
  [2011-05-18 19:39 UTC] rasmus@php.net
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 10:00:02 2025 UTC | 
Description: ------------ When doing some math with dates and "ceiling" the result, I got a negative zero! I don't understand how that can be, so I presume it's an error. Test script: --------------- <?php $dt = mktime (0, 0, 0, 5, 18, 2011); $base = mktime (16, 16, 0, 5, 18, 2011); echo 'dt: ', date ('Y-m-d', $dt), '<br />'; echo 'base: ', date ('Y-m-d', $base), '<br />'; echo '<br />'; echo 'dt - base: <strong>', ceil (($dt - $base) / 86400), '</strong>'; ?> <br /><br /> It outputs "-0" on PHP 5.3.6, under Windows XP 32 bits Expected result: ---------------- The bolded text should be "0" (zero) Actual result: -------------- The bolded text is "-0" (negative zero)