Q. What will be the output?

Code:
$a = 0;
echo $a ?: 'fallback';
  • (A) fallback
  • (B) 0
  • (C) Error
  • (D) NULL
πŸ’¬ Discuss
βœ… Correct Answer: (A) fallback
Explanation: Ternary shortcut treats 0 as false.
Explanation by: Roshan
Ternary shortcut treats 0 as false.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
30
Total Visits
πŸ“½οΈ
6 mo ago
Published
πŸŽ–οΈ
Roshan
Publisher
πŸ“ˆ
81%
Success Rate