Bug #79176 [NEW]: Since 7 years this function randomly fails when using microtime input

From: Date: Mon, 27 Jan 2020 17:44:14 +0000
Subject: Bug #79176 [NEW]: Since 7 years this function randomly fails when using microtime input
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-225161@lists.php.net to get a copy of this message
From: h dot kocznar at compunect dot com Operating system: All PHP version: 7.4.2 Package: Date/time related Bug Type: Bug Bug description:Since 7 years this function randomly fails when using microtime input Description: ------------ --- From manual page: https://php.net/datetime.createfromformat --- $foo = \DateTime::createFromFormat('U.u', \microtime(true)); This is affecting a huge amount of PHP projects, the function will fail with an error when microtime returns a float without precision values which happens when the time is exactly on that second. This problem was reported 7 years ago and the developer in charge declared the error as "not a bug" because microtime() produces "garbage". Due to the lack of professionalism on his behalf the error is still present in PHP 7.3 -- Edit bug report at https://bugs.php.net/bug.php?id=79176&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=79176&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=79176&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=79176&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=79176&r=needscript Try newer version: https://bugs.php.net/fix.php?id=79176&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=79176&r=support Expected behavior: https://bugs.php.net/fix.php?id=79176&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=79176&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=79176&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=79176&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=79176&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=79176&r=dst IIS Stability: https://bugs.php.net/fix.php?id=79176&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=79176&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=79176&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=79176&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=79176&r=mysqlcfg

« previous php.bugs (#225161) next »