Null coalescing (??)

Returns the left value if it exists and isn’t null, otherwise the right one.

PHP

Also called: ??, ??=

Example

$title = $page['title'] ?? 'Untitled';
$cache[$key] ??= expensive();   // assign only if not set yet
← Migration Updated 2026-11-26