What will be displayed in a browser when the following PHP code is executed:
<div class="question_list_op">
<?php
for ($webmull = 13; $webmull < 10; $webmull++){
echo "PHP Programming";
}
echo "Answer is: $webmull";
?>
</div>
PHP Programming Answer is: 13
PHP Programming
Answer is: 13
PHP Programming PHP Programming Answer is: 13

Correct!

Wrong!

What is the outcome of this piece of code?
<div class="question_list_op">
<?php
$webmull = "0";
if(empty){
echo "empty";
}else{
echo "not empty";
}
?>
</div>
Empty
A fatal error is generated
not empty

Correct!

Wrong!

What is the outcome of this piece of code:
<div class="question_list_op">
<?php
$webmull = 2;
while ($webmull < 10) {
echo $webmull + 1;
if ($webmull == 6) {
break;
} $webmull += 1;
}
?>
</div>
23456789
34567
246

Correct!

Wrong!

What is the outcome of this query?
<div class="question_list_op">
<?php
$web = 3;
for ($mull = 0; $mull < 8; $mull++) {
$web = $web + $mull;
}
echo $mull;
?>
</div>
3
4
8
a fatal error
13

Correct!

Wrong!

What is the outcome of this piece of code:
<div class="question_list_op">
<?php
function webmull($webmull) {
switch ($webmull) {
case 'e': print('5');
break;
case 'm': echo('6');
break;
case 'b': continue;
break;
default: echo '7';
break;
}
}

webmull('w');
webmull('e');
webmull('b');
webmull('m');
?>
</div>
7556
765
7756
756

Correct!

Wrong!

What is the output of the following code?
<div class="question_list_op">
<?php
$webmull = 3;
switch ($webmull) {
case 1: echo 'one'; break;
case 2: echo 'two'; break;
default: echo 'four'; break;
case 3: echo 'three'; break;
}<br>
?>
</div>
one
two
three
four

Correct!

Wrong!

What would be the output if 'cate' remains 5 of following code?
<div class="question_list_op">
<?php
$php = 1;
if ($php == 1) {
?>
Correct subject!
<?php
} else {
?>
Incorrect subject!
<?php
}
?>
</div>
Error due to use of invalid operator in line 6:"if ($php==1)"
Error due to incorrect syntax at line 8, 10, 12 and 14
Correct subject!
Incorrect subject!
A and b

Correct!

Wrong!

Output of the following code will be?
<div class="question_list_op">
<?php
$phpRent = 250;
function webmull($Other) {
$phpRent = 250 + $Other;
return $phpRent;
}
webmull(50);
echo $phpRent;
?>
</div>
200
250
300
Program will not compile

Correct!

Wrong!

What is the output of following code using html entity:
<div class="question_list_op">
<?php
$phpstr = "Its 'PHP';code ;";
echo htmlentities($phpstr);
?>
</div>
Its 'PHP'code
Its 'PHP'
Its 'PHP' < b>code
Its 'PHP' code
None of the above

Correct!

Wrong!

What is returned with this piece of code?
<div class="question_list_op">
<?php
error_reporting(E_ALL ^ E_NOTICE);
echo ( isset($php ['web']['mull'])) ? "0" : "1";
echo $variable;
echo '1';
?>
</div>
Notice: Undefined variable: variable
0
11

Correct!

Wrong!

Share the quiz to show your results !

Subscribe to see your results

PHP Basics Quiz questions for Control Structures

I got %%score%% of %%total%% right

%%description%%

%%description%%

Loading...