

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What does double question mark (??) operator mean in PHP ?
PHP 7 has added a new operator double question mark (??) operator. In PHP 7, the double question mark(??) operator known as Null Coalescing Operator.
It returns its first operand if it exists and is not NULL; otherwise, it returns its second operand. It evaluates from left to right. Null Coalescing operator also can be used in a chain format.
Let's take the below example to demonstrate the double question mark (??) operator.
Example
<?php //$a is not set echo $a ?? 9 ??45; ?>
Output
9
Example
<?php //$a is not set $b = 34; echo $a ?? $b ?? 7; ?>
Output
34
- Related Questions & Answers
- What does the Double Star operator mean in Python?
- What does operator ~= mean in Lua?
- What does the two question marks together (??) mean in C#?
- Double not (!!) operator in PHP
- What does the Star operator mean in Python?
- What does [Ss]* mean in regex in PHP?
- How to remove question mark from corrplot in R?
- What does these operators mean (** , ^ , %, //) ?
- Why do we use question mark literal in Python regular expression?
- What does createdCollectionAutomatically mean in MongoDB?
- What does # mean in Lua programming?
- What does series mean in pandas?
- A comma operator question in C/C++ ?
- What is the Kotlin double-bang (!!) operator?
- What does INT(7) in MySQL mean?
Advertisements