TIL: What does double question marks mean in PHP?

Today I learned about the double question mark operator introduced in PHP7.

You can use it instead of a if condition like

if (isset($array['key'])) {
  $value = $attributes['name'];
} else {
  $value = '';
}

and instead write

$value = $array['key'] ?? ''

Skriv et svar

Din e-mailadresse vil ikke blive publiceret. Krævede felter er markeret med *