Dear candidates you will find MCQ questions of PHP here. Learn these questions and prepare yourself for coming examinations and interviews. You can check the right answer of any question by clicking on any option or by clicking view answer button.
Share your questions by clicking Add Question
S
Q. Which of the conditional statements is/are supported by PHP? 1. if statements 2. if-else statements 3. if-elseif statements 4. switch statements
S
Q. What will be the output of the following PHP code?
<?php $team = "arsenal"; switch ($team) { case "manu": echo "I love man u"; case "arsenal": echo "I love arsenal"; case "manc": echo "I love manc"; } ?>
S
Q. Which of the looping statements is/are supported by PHP? 1. for loop 2. while loop 3. do-while loop 4. foreach loop
S
Q. What will be the output of the following PHP code?
<?php $user = array("Ashley", "Bale", "Shrek", "Blank"); for ($x=0; $x < count($user); $x++) { if ($user[$x] == "Shrek") continue; printf ($user[$x]); } ?>
S
Q. If $a = 12 what will be returned when ($a == 12) ? 5 : 1 is executed?
S
Q. What is the value of $a and $b after the function call?
<?php function doSomething( &$arg ) { $return = $arg; $arg += 1; return $return; } $a = 3; $b = doSomething( $a ); ?>
S
Q. Who is the father of PHP?
S
Q. How does the identity operator === compare two values?
Y
Q. What should be the correct syntax to write a PHP code?
Y
Q. Under what circumstance is it impossible to assign a default value to a parameter while declaring a function?
Don't have account? Register here.