[php-src] Issue #8351: explicit `__construct` call for \DateTimeImmutable object would break immutable
| From: | bwoebi | Date: | Wed, 13 Apr 2022 13:03:10 +0000 |
| Subject: | [php-src] Issue #8351: explicit `__construct` call for \DateTimeImmutable object would break immutable | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-240919@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/8351
Comment Author: bwoebi
I am wondering of how much of a problem this actually is. Calling __construct directly is basically
openly saying "I know what I am doing".
In my opinion it's more of an academical problem than actually a problem in practice. There is,
in my opinion, nothing wrong with giving users powerful tooling, allowing them to re-initialize
state, as long as it's not part of the default contract.
For me it's comparable to changing a private value via reflection.
I do not really consider this a bug, rather a feature.