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

From: Date: Mon, 27 Jan 2020 17:44:40 +0000
Subject: Bug #79176 [Opn]: Since 7 years this function randomly fails when using microtime input
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-225162@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=79176&edit=1 ID: 79176 User updated by: h dot kocznar at compunect dot com Reported by: h dot kocznar at compunect dot com Summary: Since 7 years this function randomly fails when using microtime input Status: Open Type: Bug Package: Date/time related Operating System: All PHP Version: 7.4.2 Block user comment: N Private report: N New Comment: Wrongly closed bug report: https://bugs.php.net/bug.php?id=64414 Previous Comments: ------------------------------------------------------------------------ [2020-01-27 17:44:14] h dot kocznar at compunect dot com 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 this bug report at https://bugs.php.net/bug.php?id=79176&edit=1

« previous php.bugs (#225162) next »