Skip to content

For discussion: should we return DateTime or DateTimeImmutable? #296

Open
@g105b

Description

@g105b

$dateFrom = $input->getDateTime("date-from");

What type of DateTime should this library return in this case? I like the simplicity of DateTime, and with it being a getter it probably doesn't matter about immutability of the object itself, but would it make more sense or would it potentially confuse someone if the returned object was DateTimeImmutable?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions