php.net |  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
Votes:3
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
Have you experienced this issue?
Rate the importance of this bug to you:

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

error_reporting(E_ALL); 

$now  = new Datetime();

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

$t = 100/5.5; 

var_dump($t);

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



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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] degeberg@php.net
-Status: Open +Status: Feedback
 [2010-07-28 12:13 UTC] degeberg@php.net
Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/

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] pajoye@php.net
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-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 22:01:26 2024 UTC