Null Coalesce Operator

What is Null Coalesce Operator which is newly introduced in php 7 ?

// ?? operator

$name = $firstName ??  "Guest";

if the value is set to not null or if value exist in the left it will return the left side value ($firstname),

if the value is null and not defined in left it will return the right side value ("Guest"),

Note: it will not through notice if $firstName variable is not defined or non-existent.

 

And you know what it is equivalent to 

$name = $firstname ? $firstname : 'guest';