1 Commits
Author SHA1 Message Date
dualfroz 0ca75d87eb fix: keep intervals built by createFromDateString() when deep copying
Since PHP 8.2 a DateInterval created by DateInterval::createFromDateString()
exposes only "from_string" and "date_string" instead of the y/m/d/h/i/s
fields, and "from_string" is ignored when assigned to. Rebuilding such an
interval by copying its visible properties onto a new DateInterval therefore
produced a zero interval, so a copied interval silently stopped shifting
dates.

Read the properties once and rebuild a date-string interval from the string
it was created from, leaving the existing property copy for every other
interval. Cloning would also fix it but would invoke __clone() on userland
DateInterval subclasses, which #76 explicitly rules out.
2026-09-03 14:34:44 +02:00