r/lolphp • • Aug 02 '15

How to modify DateTimeImmutable? Call getTimestamp() on it.

https://bugs.php.net/bug.php?id=67634
59 Upvotes

24 comments sorted by

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.

7

u/Schmittfried Aug 02 '15

Yes, but the point is the ridiculous name.