#188·DeepCopy

DateInterval from_string property not copied in PHP 8.2

Author: siduxCreated Mar 22, 2023Updated Mar 22, 2023

Since PHP 8.2

The from_string and date_string properties were added for DateInterval instances that were created using the DateInterval::createFromDateString() method.

When cloning this property is not taken into account which causes issues (some DateInterval properties get ignored)

Removing the DateIntervalFilter doesn't work.

Solution example : return new DateInterval($element->format('%rP%yY%mM%dDT%hH%iM%sS'));