From: Operating system: win7 x86 PHP version: 5.3.2 Package: Date/time related Bug Type: Bug Bug description:DateTime::diff affects round()
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 bug report at http://bugs.php.net/bug.php?id=52242&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=52242&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=52242&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=52242&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=52242&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=52242&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=52242&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=52242&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=52242&r=needscript Try newer version: http://bugs.php.net/fix.php?id=52242&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=52242&r=support Expected behavior: http://bugs.php.net/fix.php?id=52242&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=52242&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=52242&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=52242&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=52242&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=52242&r=dst IIS Stability: http://bugs.php.net/fix.php?id=52242&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=52242&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=52242&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=52242&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=52242&r=mysqlcfg