-1

what is the meaning of '??' operator in php? I've seen someone using it like this. I've searched many results in google. But didn't found any solution.

$this->variable = $arg['value'] ?? NULL

Adam
  • 437
  • 1
  • 4
  • 12

1 Answers1

1

?? is the new (since PHP 7) NULL coalescing operator. If the first argument is set and is not null it is returned, otherwise, the second argument is returned.

Mureinik
  • 297,002
  • 52
  • 306
  • 350