πŸ“Š PHP
Q. What will be the output?
Code:
declare(strict_types=1);
function add(int $a, int $b) { return $a + $b; }
echo add('5', 5);
  • (A) 10
  • (B) Error
  • (C) 55
  • (D) NULL
πŸ’¬ Discuss
βœ… Correct Answer: (B) Error

Explanation: Strict types prevent implicit conversion from string to int.

Explanation by: Roshan
Strict types prevent implicit conversion from string to int.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
3
Total Visits
πŸ“½οΈ
8 d ago
Published
πŸŽ–οΈ
Roshan
Publisher
πŸ“ˆ
97%
Success Rate