#45866 [Ver->Asn]: decimal values fed to DateTime->modify() causes long execution times

From: Date: Fri, 12 Sep 2008 14:32:23 +0000
Subject: #45866 [Ver->Asn]: decimal values fed to DateTime->modify() causes long execution times
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-128914@lists.php.net to get a copy of this message
ID: 45866 Updated by: derick@php.net Reported By: jsnell at e-normous dot com -Status: Verified +Status: Assigned Bug Type: Date/time related Operating System: Debian Linux with 2.6.22-2-amd64 PHP Version: 5.3CVS-2008-08-20 (snap) -Assigned To: +Assigned To: derick 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

« previous php.bugs (#128914) next »