DateTimeImmutable::modify — Creates a new object with modified timestamp
Description
#[\NoDiscard(message: "as DateTimeImmutable::modify() does not modify the object itself")] publicfunctionDateTimeImmutable::modify(string$modifier): DateTimeImmutable
Creates a new DateTimeImmutable object with modified timestamp.
The original object is not modified.
DateTimeImmutable::modify() now throws
DateMalformedStringException if an
invalid string is passed. Previously, it returned false,
and a warning was emitted.