πŸ“Š PHP
Q. What will be the output of the following PHP code ?
Code:
<?php
switch($k)
{
case 2:
    print "First";
    break;
case k:
    print "Second";
    break;
}
?>
  • (A) Undefined variable: k
  • (B) First
  • (C) Second
  • (D) Nothing
πŸ’¬ Discuss
βœ… Correct Answer: (A) Undefined variable: k

Explanation: Case cannot be defined by a variable.

Explanation by: Parvesh Kanani
Case cannot be defined by a variable.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
161
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Parvesh Kanani
Publisher
πŸ“ˆ
94%
Success Rate