Bug #81500 [Asn->Csd]: Interval serialization regression since 7.3.14 / 7.4.2
Edit report at https://bugs.php.net/bug.php?id=81500&edit=1
ID: 81500
Updated by: git@php.net
Reported by: kylekatarnls at gmail dot com
Summary: Interval serialization regression since 7.3.14 /
7.4.2
-Status: Assigned
+Status: Closed
Type: Bug
Package: Date/time related
PHP Version: 8.0.11
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of cmb69
Revision: https://github.com/php/php-src/commit/866adb122a4a1d7062771fb7d239029b23c61d7a
Log: Fix #81500: Interval serialization regression since 7.3.14 / 7.4.2
Previous Comments:
------------------------------------------------------------------------
[2021-10-15 13:56:42] cmb@php.net
> The type is int, but should be float.
This cannot be fixed for BC reasons[1].
> If it's supposed to not accept negative numbers (which I agree),
> then I'd expect it to be converted to 0 not -1.
Generally, negative values are supported just fine, so we cannot
change this for BC reasons either.
The intention was to return FALSE when reading the property, but
that won't happen due to the mentioned issue[1].
[1] <https://github.com/php/php-src/pull/7575#issuecomment-943265422>
------------------------------------------------------------------------
[2021-10-15 11:49:49] alec at alec dot pl
My two cents. I see two issues here:
1. The type is int, but should be float.
2. If it's supposed to not accept negative numbers (which I agree), then I'd expect it to
be converted to 0 not -1.
Former is an obvious bug, but for the latter I'm not sure. What's a usual PHP behavior is
such cases.
------------------------------------------------------------------------
[2021-10-13 10:47:36] cmb@php.net
The following pull request has been associated:
Patch Name: Fix #81500: Interval serialization regression since 7.3.14 / 7.4.2
On GitHub: https://github.com/php/php-src/pull/7575
Patch: https://github.com/php/php-src/pull/7575.patch
------------------------------------------------------------------------
[2021-10-12 09:37:07] cmb@php.net
The following pull request has been associated:
Patch Name: Fix #81500: Interval serialization regression since 7.3.14 / 7.4.2
On GitHub: https://github.com/php/php-src/pull/7572
Patch: https://github.com/php/php-src/pull/7572.patch
------------------------------------------------------------------------
[2021-10-12 09:36:44] cmb@php.net
Well, actually the *un*serialization is correct, because negative
values of DateInterval::$f are not supposed to be supported.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=81500
--
Edit this bug report at https://bugs.php.net/bug.php?id=81500&edit=1
Thread (8 messages)