Commit Graph
3 Commits
Author SHA1 Message Date
upstream e23bc8d851 Upstream myclabs/DeepCopy state of the touched files before 7fb5af511d 2026-09-03 14:34:44 +02:00
dualfroz e6d94fc32a 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-06 00:57:12 +02:00
upstream 0ea3878598 Upstream myclabs/DeepCopy state of the touched files before 6d74592b9e 2026-09-03 14:34:44 +02:00