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

Correct!

Wrong!

What is the output?
<div class="question_list_op">
<?php
define("PHP", "php");
define("WEBMUL", "1");

function webmull() {
echo PHP;
echo WEBMULL;
}

ECHO "=>";
echo webmull();
?>
</div>
=>
=>phpWEBMULL
=>php1
=>PHPWEBMULL

Correct!

Wrong!

What is the outcome of this piece of code:
<div class="question_list_op">
<?php
var_dump(is_real(10.00));
var_dump(is_scalar(array('web', 'mull')));
?>
</div>
(bool)false (bool)false
(bool)true (bool)false-ans
(bool)true (bool)true
(bool)false (bool)true

Correct!

Wrong!

What is the outcome of this piece of code:
<div class="question_list_op">
<?php
$W = 50;
$E = '50';
$B = true;
$M = 'php';>
echo ( $W == $E ) ? " equal " : " not equal ";
echo ( $B == $M ) ? " equal " : " not equal ";
echo ( $B === "php") ? " equal " : " not equal ";
?>
</div>
equal equal not equal
not equal not equal not equal
equal not equal not equal
equal equal equal

Correct!

Wrong!

What is the outcome of this piece of code:
<div class="question_list_op">
<?php
var_dump(is_int(11));
var_dump(is_int("11"));
var_dump(is_int(11.7));
var_dump(is_int(true));
?>
</div>
bool(true)bool(true)bool(true)bool(false)
bool(true)bool(true)bool(false)bool(false)
bool(true)bool(false)bool(false)bool(false)
bool(true)bool(true)bool(true)bool(true)

Correct!

Wrong!

What is the outcome of this piece of code:
<div class="question_list_op">
<?php
echo (string) 7;
echo (string) 7.5;
echo (string) array('5','2');
echo (float) 'webmull';
?>
</div>
120
77.5Array0
77.5120
Array0

Correct!

Wrong!

What will be the value of $webmull after this code executes? Explain your answer.
<div class="question_list_op">
<?php
$webmull = NULL;<br>
<br>
if ('0xFF' == 255) {
$webmull = (int)'0xFF';
}
echo $webmull;
?>
</div>
1
0
false
true

Correct!

Wrong!

What Ouput of the following code will be?
<div class="question_list_op">
<?php
for ($i = 0; $i < 5; ++$i)
{<br>
if ($i ==2);
continue;
print "$i\n";
}
?>
</div>
0 12345
0 134
2
0 124
None of the above

Correct!

Wrong!

What will be displayed in a browser when the following PHP code is executed:
<div class="question_list_op">
<?php
$php_variable = 1;
switch ($php_variable) {
case 1:
echo "Hello Webmull";
default:
echo "Webmull PHP";
break;
}
?>
</div>
Hello Webmull
Hello WebmullWebmull PHP
Hello WebmullWebmull PHP
Nothing Will Be Displayed

Correct!

Wrong!

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

Correct!

Wrong!

Share the quiz to show your results !

Subscribe to see your results

PHP Basics Quiz questions for data type and Control Structures

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

%%description%%

%%description%%

Loading...