#48149 [Opn->Ver]: Cannot make interval parts larger than 9999.
| From: | fa@php.net | Date: | Mon, 04 May 2009 23:12:20 +0000 |
| Subject: | #48149 [Opn->Ver]: Cannot make interval parts larger than 9999. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-136773@lists.php.net to get a copy of this message | ||
ID: 48149
Updated by: fa@php.net
Reported By: lists at reptiliannature dot org
-Status: Open
+Status: Verified
Bug Type: Date/time related
Operating System: ALL
PHP Version: 5.3.0RC1
New Comment:
Still present in 5.3.0RC2
Previous Comments:
------------------------------------------------------------------------
[2009-05-04 21:20:13] lists at reptiliannature dot org
Description:
------------
This bug seems to be identical to http://bugs.php.net/bug.php?id=45545
which was marked closed.
It appears than when part of the interval is greater than 9999 the
DateInterval throws an exception.
DateInterval::__construct(): Unknown or bad format (PT10000M);
This happens with years, days, hours, minutes, and seconds
Reproduce code:
---------------
$i = 900;
while ($i) {
try {
$di = new DateInterval('PT' . $i . 'M');
}
catch (exception $e) {
var_dump($i);
echo $e->getMessage();
break;
}
$i++;
}
Expected result:
----------------
I would expect to have a DateInterval object with interval ('PT1000M')
or greater.
Actual result:
--------------
DateInterval::__construct(): Unknown or bad format (PT10000M);
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=48149&edit=1