Doc #73551 [Opn]: DateTime with improved microsec BC change not documented in 7.1 migration guide
| From: | requinix@php.net | Date: | Thu, 17 Nov 2016 07:49:26 +0000 |
| Subject: | Doc #73551 [Opn]: DateTime with improved microsec BC change not documented in 7.1 migration guide | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-14114@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=73551&edit=1
ID: 73551
Updated by: requinix@php.net
Reported by: aa dot vasilenko at gmail dot com
-Summary: new DateTime() with microsec is BC
+Summary: DateTime with improved microsec BC change not
documented in 7.1 migration guide
Status: Open
Type: Documentation Problem
-Package: Documentation problem
+Package: Date/time related
-PHP Version: 7.1.0RC6
+PHP Version: 7.1.0RC4
Block user comment: N
Private report: N
New Comment:
You couldn't assume that anyways: it was unlikely, but still possible that time would change
during the few microseconds between new instances, eg. 12:00:00.999999 to 12:00:01.000000.
Note that the microseconds improvements happened with RC4.
https://3v4l.org/E2fdA
https://github.com/php/php-src/commit/55626549d81d0feadb1d160be78fcf2b898a48cc
Previous Comments:
------------------------------------------------------------------------
[2016-11-17 07:30:40] aa dot vasilenko at gmail dot com
Description:
------------
Fix for #48225 in 7.10RC4 broke tests on our side. Basically now it's not possible to assume
that 2
\new DateTime() are the same. Of course this is bad behavior but I'm nearly
sure that a lot of business logic is using it.
Would be nice to list it as a breaking change in documentation or "What's New" to
prepare developers better for upcoming 7.1 release
Test script:
---------------
<?php
$a = new DateTime();
for ($i = 0; $i < 100; $i++) {
//noop, just to let some microseconds pass
}
$b = new DateTime();
var_dump($a == $b);
Expected result:
----------------
true
//<7.1RC4
Actual result:
--------------
false
//>=7.1RC4
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=73551&edit=1