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: Feedback +Status: Open Type: Bug Package: Date/time related Operating System: win7 x86 PHP Version: 5.3.2 New Comment: I use vc6 TS Previous Comments: ------------------------------------------------------------------------ [2010-07-03 18:56:03] paj...@php.net Which binary do you use? (vc6, vc9, ts, nts)? ------------------------------------------------------------------------ [2010-07-03 18:12:18] hrach dot cz at gmail dot com I have no expiriences with that in other cases. So, yes, it happens only when diff is used. ------------------------------------------------------------------------ [2010-07-03 18:01:02] paj...@php.net Does it happen only when the DateTime::diff method is used? I mean: never happened otherwise? ------------------------------------------------------------------------ [2010-07-03 17:18:49] hrach dot cz at gmail dot com I copied old version of definition $t, should be: $t = new DateTime('2010-08-03'); ------------------------------------------------------------------------ [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