[php-src] Issue #8351: explicit `__construct` call for \DateTimeImmutable object would break immutable
| From: | nicolas-grekas | Date: | Thu, 14 Apr 2022 11:42:07 +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-240963@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/8351
Comment Author: nicolas-grekas
I agree with @bwoebi and @derickr personnaly. "Encapsulation" relates to the public API of
some software design. A constructor doesn't belong to what "encapsulation" refers to.
Yes, you can mutate the object. So does reflection with private properties. Cllaing the constructor
is like using reflection to me: do it if you know why you shouldn't :shrug: ...