TAG ARCHIVE
Everything on immutability.
2 articles tagged immutability, sorted newest first.
php
PHP 8.5 #[\NoDiscard]: Stop Silently Ignoring Return Values That Matter
PHP 8.5 ships a new #[\NoDiscard] attribute that warns when you forget to use a function's return value. Here is how to apply it to your own immutable builders — and why (void) is the only safe way to suppress it.
7 min read →
php
PHP 8.5 clone with: Updating Readonly Objects Without Boilerplate
PHP 8.5 lets you pass an array to clone() to update properties in one expression. Here's how it replaces wither method boilerplate: and the gotchas you need to know first.
4 min read →