Output of following PHP code?
<div class="question_list_op">
<?php
if (3.2)
print "true";
else
print "false";
?>
</div>
True
False

Correct!

Wrong!

what will be the output of below code ?
<div class="question_list_op">
<?php
$webmull="99.9degrees";
(double)$webmull;
(int)$webmull;
(string)$webmull;
echo $webmull;
?>
</div>
99.9degrees
99.9
99
degrees

Correct!

Wrong!

what will be the output of below code ?
<div class="question_list_op">
<?php
$webmull="21.6degrees";
(double)$webmull;
(int)$webmull;
echo (string)$webmull;
?>
</div>
21.6
degrees
21
21.6degrees

Correct!

Wrong!

What will be printed?
<div class="question_list_op">
<?php
$php_var = '0';
if ($php_var) {
echo 'true';
} else {
echo 'false';
}
?>
</div>
true
false

Correct!

Wrong!

What will be printed?
<div class="question_list_op">
<?php
$webmull = array();
if ($webmull == null) {
echo 'true';
} else {
echo 'false';
}
?>
</div>
true
false

Correct!

Wrong!

What will be printed?
<div class="question_list_op">
<?php
$webmull = array();
if ($webmull == null) {
echo 'true';
} else {
echo 'false';
}
?>
</div>
true
false

Correct!

Wrong!

What will be printed?
<div class="question_list_op">
<?php
if ('6' == '06') {
echo 'true';
} else {
echo 'false';
}
?>
</div>
true
false

Correct!

Wrong!

What is the outcome of this piece of code:
<div class="question_list_op">
<?php
$a = "";
echo gettype($a);
echo empty($a);
echo is_null($a);
echo isset($x);
?>
</div>
string1
0011
string101
101

Correct!

Wrong!

What is the outcome of this piece of code:
<div class="question_list_op">
<?php
$webmull = true;
echo $webmull;
?>
</div>
TRUE
true
1
nothing is returned

Correct!

Wrong!

What is the output of this piece of code:
<div class="question_list_op">
<?php
$web = 16;
$mull = '16';
echo $web == $mull;
?>
</div>
TRUE
1
no output
False

Correct!

Wrong!

What is the output of this piece of code:
<div class="question_list_op">
<?php
var_dump(79);
var_dump(079);
?>
</div>
int(79)int(7)
797
7979
int(79)int(79)

Correct!

Wrong!

Share the quiz to show your results !

Subscribe to see your results

PHP Basics Quiz questions for data type

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

%%description%%

%%description%%

Loading...