Time & Date Deprecated

I think it’s because of the number of bugs that people get when they do things like $entity->some_date->addYear()->format('xxx') to generate a readable version of a year after the date in question, without realizing that this changes the date in the entity. Making everything immutable means that you have to make your intention clear when you want to change it.

1 Like