Edit report at http://bugs.php.net/bug.php?id=52242&edit=1
ID: 52242
User updated by: hrach dot cz at gmail dot com
Reported by: hrach dot cz at gmail dot com
Summary: DateTime::diff affects round()
Status: Open
Type: Bug
Package: Date/time related
Operating System: win7 x86
PHP Version: 5.3.2
New Comment:
I copied old version of definition $t, should be:
$t = new DateTime('2010-08-03');
Previous Comments:
------------------------------------------------------------------------
[2010-07-03 17:14:58] hrach dot cz at gmail dot com
Description:
------------
If I use diff method (doesn't matter on which variable),
usually (unfortunatelly not allways) round function returned some char
(@, U, :, <, ...)
I was not able to realize cases. :(
Test script:
---------------
<?php
$t = new DateTime();
$s = new DateTime('2010-08-01');
$diff = $t->diff($s, true)->format('%d');
echo $diff ."\n";
$var = 98232923;
$mod = 82342;
$dur = round($var / $mod);
echo $dur;
Expected result:
----------------
2
1193
Actual result:
--------------
2
Å®
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=52242&edit=1