|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52469 Datetime affect the division
Submitted: 2010-07-28 12:05 UTC Modified: 2013-05-05 14:27 UTC
Avg. Score:5.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:2 (66.7%)
Same OS:2 (66.7%)
From: info at mirgorod dot ru Assigned:
Status: No Feedback Package: Date/time related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: info at mirgorod dot ru
New email:
PHP Version: OS:


 [2010-07-28 12:05 UTC] info at mirgorod dot ru
Several launches of 1911 affects the operation of division in php 5.3.2:


$now  = new Datetime();

for ($i = 0; $i < 4; $i++) 
    $a = $now->diff($now); 

$t = 100/5.5; 


// first running: float(18.181818181818)
// after update page: Warning:  Division by zero in G:\www\test.php on line 10


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-07-28 12:09 UTC] info at mirgorod dot ru
Sorry, this true description: Several launches of diff affects the operation of division in php 5.3.2:
 [2010-07-28 12:13 UTC]
-Status: Open +Status: Feedback
 [2010-07-28 12:13 UTC]
Please try using this snapshot:
For Windows:

Can't reproduce using 5.3-dev from SVN.
 [2011-03-11 13:04 UTC] arialdomartini at gmail dot com
I'm able to reproduce this bug on

Windows Vista, PHP 5.3.(2/4/5)
 [2013-02-18 00:34 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 [2013-05-05 14:20 UTC] anka17pinky at yahoo dot com
I have the same issue with PHP 5.3.0.

This makes the diff function unusable :(
 [2013-05-05 14:27 UTC]
Updating to latest 5.3 is a must, no matter if you see this bug or not.
 [2013-05-05 15:12 UTC] anka17pinky at yahoo dot com
You mean 5.4.

Because this bug is present in 5.3.
5.4.3 seems ok though (didn't test others besides 5.3.0)
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Aug 02 20:01:24 2021 UTC