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

From: Date: Tue, 11 Nov 2008 10:47:55 +0000
Subject: #45866 [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-130872@lists.php.net to get a copy of this message
ID: 45866 Updated by: jani@php.net Reported By: jsnell at e-normous dot com Status: Assigned Bug Type: Date/time related -Operating System: Debian Linux with 2.6.22-2-amd64 +Operating System: * -PHP Version: 5.3CVS-2008-08-20 (snap) +PHP Version: 5CVS, 6CVS (2008-11-11) Assigned To: derick New Comment: Happens in all branches. 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 (#130872) next »