Output of the below given code will be?
<div class="question_list_op">
<?php
$php_var = 18;
if($php_var > 6 OR < 20)
echo "true";
else
echo "false"
?>
</div>
True
False
No output
Parse Error

Correct!

Wrong!

What would be the output of following php script:
<div class="question_list_op">
<?php
print 'Webmull Quiz1' print 'Webmull Quiz2'
?>
</div>
'Webmull Quiz1'
'Webmull Quiz2'
Error message will be printed
Webmull Quiz1Webmull Quiz2
Webmull Quiz1 Webmull Quiz2

Correct!

Wrong!

What output of the following code will be?
<div class="question_list_op">
<?php
function webmull($php_var) {
$php_var = $php_var - ($php_var / 5 * 3);
return $php_var;
}
echo webmull(150);
?>
</div>
140
Error message
150
60
None of the above

Correct!

Wrong!

What is the value of echo 4+1 * 5+7 expression?
<div class="question_list_op">
<?php
echo 4+1 * 5+7;
?>
</div>
34
21
50
70
16

Correct!

Wrong!

What will be the output of -
echo 12 . 6?
<div class="question_list_op">
<?php<br>
echo 12 . 6
?>
</div>
126
12.6
18
Error: You cannot add integers through the concatenation operator(.)

Correct!

Wrong!

What will be the value of code:
$web = 0xFFFE;
$mull = 18;
$webmull = $web && $mull;
What will be the value of $webmull?
<div class="question_list_op">
<?php
$web = 0xFFFE;
$mull = 18;
$webmull = $web && $mull;
echo $webmull;
?>
</div>
2
3
4
0
1

Correct!

Wrong!

Output of the following code will be?
<div class="question_list_op">
<?php
$phpa = 500;
$phpb = 200;
echo $phpa % 2 * $phpb;
?>
</div>
200
500
100
0
Syntax error

Correct!

Wrong!

Output of
<?php echo 20 * 1.7; ?>
<div class="question_list_op">
<?php echo 20 * 1.7; ?>
</div>
20.7
20 * 1.7
34
Expressions can't be used with echo statements
None of the above

Correct!

Wrong!

Output of the following code will be?
<div class="question_list_op">
<?php
$web = 5;
$mull = 18;
$webmull = 2;
$webmull = $mull++ / $web++;
echo $web . " " . $mull . " " . $webmull . " ";
?>
</div>
6 19 3
5 19 3.6
6 19 2
6 19 3.1
6 19 3.6

Correct!

Wrong!

What will the output of following php code?
<div class="question_list_op">
<?php
$web = 1;
$mull = 11;
$webmull = 6;
$webmull = $mull++ / $web++ + --$webmull;
echo $webmull;
?>
</div>
19
15
16
11
17

Correct!

Wrong!

Share the quiz to show your results !

Subscribe to see your results

PHP Basics Quiz questions for syntax and operators

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

%%description%%

%%description%%

Loading...