#45866 [Opn->Ver]: decimal values fed to DateTime->modify() causes long execution times
| From: | lbarnaud@php.net | Date: | Fri, 12 Sep 2008 14:23:47 +0000 |
| Subject: | #45866 [Opn->Ver]: decimal values fed to DateTime->modify() causes long execution times | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-128912@lists.php.net to get a copy of this message | ||
ID: 45866
Updated by: lbarnaud@php.net
Reported By: jsnell at e-normous dot com
-Status: Open
+Status: Verified
Bug Type: Date/time related
Operating System: Debian Linux with 2.6.22-2-amd64
PHP Version: 5.3CVS-2008-08-20 (snap)
Previous Comments:
------------------------------------------------------------------------
[2008-08-20 03:58:45] jsnell at e-normous dot com
Description:
------------
Feeding a decimal value to DateTime's modify() function can cause very
long execution times because the decimal point is ignored.
Reproduced on the php5.3-200808200230 snapshot.
Reproduce code:
---------------
$date = new DateTime();
$date->modify("+1.61538461538 day");
Expected result:
----------------
A warning or exception, or perhaps 1 day + 0.61538461538*24 hours
added.
Actual result:
--------------
after 32 seconds of execution, 161538461538 days are added to the date
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=45866&edit=1