what is the output of below script? <?php


Top Questions

<?php
$x
= 3;
switch (
$x) {
case
2: echo 'line 1'; break;
case
3:
case
4: echo 'line 2'; break;
default: echo
'line 3';
}
?>

a. echo 'line 3';

b. echo 'line 2';

c. Error

d. None of the above

Ans: b (Answer is line2)

www.w3answers.com

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
3 + 10 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.

Check It !

Tweet It

W3 Updates

Stay informed on our latest news!

Syndicate content