Closed gszy closed 6 years ago
When checking whether Element\DateTime’s value is an actual PHP DateTime, it’s more useful to check if it’s an instance of DateTimeInterface, since such approach allows to use either DateTime or DateTimeImmutable object as element value.
Element\DateTime
DateTime
DateTimeInterface
DateTimeImmutable
Thnaks, @gscscnd
When checking whether
Element\DateTime
’s value is an actual PHPDateTime
, it’s more useful to check if it’s an instance ofDateTimeInterface
, since such approach allows to use eitherDateTime
orDateTimeImmutable
object as element value.