Also called: ??, ??=
Example
$title = $page['title'] ?? 'Untitled';
$cache[$key] ??= expensive(); // assign only if not set yet
← Migration
Updated 2026-11-26
Returns the left value if it exists and isn’t null, otherwise the right one.
Also called: ??, ??=
$title = $page['title'] ?? 'Untitled';
$cache[$key] ??= expensive(); // assign only if not set yet