The null coalescing assignment operator

Setting a default only when a key is missing was $a['k'] = $a['k'] ?? $v;, which evaluates the subscript twice and reads as a statement about itself.

$options['timeout'] ??= 30;

// and the case that actually matters — a lazy property
public function client(): ClientInterface
{
    return $this->client ??= new Client($this->config);
}

The right-hand side is only evaluated when the left is null, which is the property that makes the lazy-initialisation form correct — a plain ?? assignment constructs the object every time and then throws it away. It works on array offsets, properties and static properties, and it uses the same isset semantics as ??, so an existing key holding null is treated as absent. That last part catches people whose config genuinely distinguishes the two.