Bug #68187 [NEW]: Strange behavior DateInterval in PHP
| From: | e45456 at yandex dot ru | Date: | Wed, 08 Oct 2014 13:54:39 +0000 |
| Subject: | Bug #68187 [NEW]: Strange behavior DateInterval in PHP | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-187956@lists.php.net to get a copy of this message | ||
From: e45456 at yandex dot ru
Operating system: Ubuntu 14
PHP version: Irrelevant
Package: Date/time related
Bug Type: Bug
Bug description:Strange behavior DateInterval in PHP
Description:
------------
Strange behavior DateInterval in PHP.
I think it is a php bug.
Test script:
---------------
$i1 = DateInterval::createFromDateString('10 minutes');
$i2 = DateInterval::createFromDateString('30 minutes');
var_dump($i1 > $i2);
var_dump($i1 > $i2);
var_dump($i1);
var_dump($i1 > $i2);
var_dump($i1 > $i2);
Expected result:
----------------
bool(false)
bool(false)
object(DateInterval)#3 (8) {
...
}
bool(false)
bool(false)
Actual result:
--------------
bool(false)
bool(false)
object(DateInterval)#3 (8) {
...
}
bool(true)
bool(true)
--
Edit bug report at https://bugs.php.net/bug.php?id=68187&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=68187&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=68187&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=68187&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=68187&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=68187&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=68187&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=68187&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=68187&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=68187&r=support
Expected behavior: https://bugs.php.net/fix.php?id=68187&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=68187&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=68187&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=68187&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=68187&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=68187&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=68187&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=68187&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=68187&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=68187&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=68187&r=mysqlcfg