You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to deprecate DateTimeType, DateTimeTzType, DateType, TimeType and VarDateTimeType in favor of their immutable siblings. Possibly also alias the names in 3.0 so datetime uses immutable by default.
Using mutable DateTime is generally discouraged as of DateTimeImmutable addition in PHP 5.5. It leads to many WTF effects due to methods like modify() that modify itself, but also is not supported i.e. in ORM which does object identity comparison (so modify() will not be persisted, see ORM gotcha). Docs should be updated in 2.x to suggest immutables as well.
The text was updated successfully, but these errors were encountered:
DBAL doesn't touch the DateTime instances, so we're safe in this library.
What we can (and probably should) do in ORM is triggering deprecation warnings during metadata validation.
I fully agree with the fact that DateTime is obsolete and inadequate these days, but we provide a functionally pure API for type conversion, so the mutability is not an issue for DBAL itself.
I'd like to deprecate DateTimeType, DateTimeTzType, DateType, TimeType and VarDateTimeType in favor of their immutable siblings. Possibly also alias the names in 3.0 so
datetime
uses immutable by default.Using mutable DateTime is generally discouraged as of DateTimeImmutable addition in PHP 5.5. It leads to many WTF effects due to methods like
modify()
that modify itself, but also is not supported i.e. in ORM which does object identity comparison (somodify()
will not be persisted, see ORM gotcha). Docs should be updated in 2.x to suggest immutables as well.The text was updated successfully, but these errors were encountered: