Bug #70381 [NEW]: DateInterval comparsion wrong

From: Date: Fri, 28 Aug 2015 10:48:17 +0000
Subject: Bug #70381 [NEW]: DateInterval comparsion wrong
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-195587@lists.php.net to get a copy of this message
From:             accido at ukr dot net
Operating system: Xubuntu 14
PHP version:      5.6.13RC1
Package:          Date/time related
Bug Type:         Bug
Bug description:DateInterval comparsion wrong

Description:
------------
Wrong DateInterval comparsion result

Test script:
---------------
$a = new DateTime('1981-10-10');
$b = new DateTime('1980-10-01');
$m = new DateInterval('P1M');
var_dump($a->diff($b) > $m);
//bool(false)



-- 
Edit bug report at https://bugs.php.net/bug.php?id=70381&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=70381&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=70381&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=70381&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=70381&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=70381&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=70381&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=70381&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=70381&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=70381&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=70381&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=70381&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=70381&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=70381&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70381&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=70381&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=70381&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=70381&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=70381&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=70381&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=70381&r=mysqlcfg



Thread (6 messages)

« previous php.bugs (#195587) next »