3

What is the difference between null coalesce operator and elvis?

$a = null; echo $a ?: 'default1'; echo $a ?? 'default2'; 

It looks to me as they are doing the same job. However there must be difference. :)

Can someone point it out for me?

1
  • Hey, the exact same thing popped into my mind Commented Feb 12, 2018 at 8:02

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.