Skip to content
On this page

Expressions: Null Coalescing Operation

The null coalesce operator can be used to conditionally evaluate an expression using the ?? operator, followed by the expression to evaluate if the value is null.

$foo = $bar ?? $baz;

Licensed under either of the MIT License or the Apache License (Version 2.0), at your option.