History log of /PHP-7.4/ext/date/tests/bug81500.phpt (Results 1 – 1 of 1)
Revision Date Author Comments
# 866adb12 15-Oct-2021 Christoph M. Becker

Fix #81500: Interval serialization regression since 7.3.14 / 7.4.2

While it may not be desired, `DateInterval::$f` supports negative
values, at least with regard to calculations. We sti

Fix #81500: Interval serialization regression since 7.3.14 / 7.4.2

While it may not be desired, `DateInterval::$f` supports negative
values, at least with regard to calculations. We still need to guard
from assigning double values which are out of range for signed 64bit
integers (which would be undefined behavior). zend_dval_to_lval() does
this by returning `0` instead of triggering UB. This way we can avoid
setting the invalid marker, which doesn't work as expected anyway.

We must not do that only for unserialization, but also when the property
is set in the first place.

We need to adapt some of the existing tests wrt. this behavior. In
particular, we check for an arbitrary value in bug79015.phpt, to cater
to differences between 32bit and 64bit architectures.

Closes GH-7575.

show more ...