#48149 [Csd]: Cannot make interval parts larger than 9999
| From: | lists at reptiliannature dot org | Date: | Tue, 05 May 2009 13:57:14 +0000 |
| Subject: | #48149 [Csd]: Cannot make interval parts larger than 9999 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-136796@lists.php.net to get a copy of this message | ||
ID: 48149
User updated by: lists at reptiliannature dot org
Reported By: lists at reptiliannature dot org
Status: Closed
Bug Type: Date/time related
Operating System: *
PHP Version: 5.3, 6CVS (2009-05-05)
New Comment:
No problem thank you.
Previous Comments:
------------------------------------------------------------------------
[2009-05-05 07:45:24] derick@php.net
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Hah, I had fixed it in the parser, but not ran the regenerator to the
.c file. Should be fixed in CVS now.
------------------------------------------------------------------------
[2009-05-04 23:12:20] fa@php.net
Still present in 5.3.0RC2
------------------------------------------------------------------------
[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