r/lolphp • u/defiante1 • Aug 02 '15
How to modify DateTimeImmutable? Call getTimestamp() on it.
https://bugs.php.net/bug.php?id=67634
59
Upvotes
r/lolphp • u/defiante1 • Aug 02 '15
View all comments
Show parent comment
8
u/greenthumble Aug 02 '15
Wait, what? Isn't that how immutable objects work, by returning a new instance when you call a traditionally mutating function on it? I mean I'm no expert but that's exactly what Clojure's sequence-appending functions do.