Doc #73551 [Ver->Csd]: DateTime with improved microsec BC change not documented in 7.1 migration guide
| From: | cmb@php.net | Date: | Fri, 18 Nov 2016 11:11:53 +0000 |
| Subject: | Doc #73551 [Ver->Csd]: 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-14122@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: cmb@php.net
Reported by: aa dot vasilenko at gmail dot com
Summary: DateTime with improved microsec BC change not
documented in 7.1 migration guide
-Status: Verified
+Status: Closed
Type: Documentation Problem
Package: Date/time related
PHP Version: 7.1.0RC4
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
> This seems like a doc issue @cmb ?
Yes, and I've just fixed it (see above).
Previous Comments:
------------------------------------------------------------------------
[2016-11-18 11:10:02] krakjoe@php.net
I believe there was a note in upgrading.
This seems like a doc issue @cmb ?
------------------------------------------------------------------------
[2016-11-18 11:09:53] cmb@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation better.
Fixed with <http://svn.php.net/viewvc?view=revision&revision=341067>.
------------------------------------------------------------------------
[2016-11-17 08:45:27] aa dot vasilenko at gmail dot com
You're absolutely right. But still it was working 99.5% of the time :). As I said - it would be
great to include it in migration guide, do not "fix" it.
------------------------------------------------------------------------
[2016-11-17 07:49:26] requinix@php.net
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
------------------------------------------------------------------------
[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