adplus-dvertising

Welcome to the Constants and Operators in PHP MCQs Page

Dive deep into the fascinating world of Constants and Operators in PHP with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Constants and Operators in PHP, a crucial aspect of PHP. In this section, you will encounter a diverse range of MCQs that cover various aspects of Constants and Operators in PHP, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within PHP.

frame-decoration

Check out the MCQs below to embark on an enriching journey through Constants and Operators in PHP. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of PHP.

Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of Constants and Operators in PHP. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

Constants and Operators in PHP MCQs | Page 8 of 12

Q71.
What will be the output of the following PHP code ?
<?php
$y = 2;
if (--$y <> ($y != $y++))
{
    echo $y;
}
?>
Discuss
Answer: (b).0
Q72.
What will be the output of the following PHP code ?
<?php
echo $x-- != ++$x;
?>
Discuss
Answer: (a).1
Q73.
What will be the output of the following PHP code ?
<?php
$auth = 1;
$status = 1;
if ($result = (($auth == 1) && ($status != 0)))
{
    print "result is $result<br />";
}
?>
Discuss
Answer: (b).result is 1
Q74.
What will be the output of the following PHP code ?
<?php
$i = 0;
while ($i = 10)
{   
    print "hi";
}
print "hello";
?>
Discuss
Answer: (b).infinite loop
Q75.
What will be the output of the following PHP code ?
<?php
$i = "";
while ($i = 10)
{   
    print "hi";
}
print "hello";
?>
Discuss
Answer: (b).infinite loop
Q76.
What will be the output of the following PHP code ?
<?php
$i = 5;
while (--$i > 0)
{   
    $i++;
    print $i;
    print "hello";
}
?>
Discuss
Answer: (a).4hello4hello4hello4hello4hello…..infinite
Q77.
What will be the output of the following PHP code ?
<?php
$i = 5;
while (--$i > 0 && ++$i)
{   
    print $i;
}
?>
Discuss
Answer: (b).555555555…infinitely
Q78.
What will be the output of the following PHP code ?
<?php
$i = 5;
while (--$i > 0 || ++$i)
{   
    print $i;
}
?>
Discuss
Answer: (a).54321111111….infinitely
Q79.
What will be the output of the following PHP code ?
<?php
$i = 0;
while(++$i || --$i)
{   
    print $i;
}
?>
Discuss
Answer: (a).1234567891011121314….infinitely
Q80.
What will be the output of the following PHP code ?
<?php
$i = 0;
while (++$i && --$i)
{   
    print $i;
}
?>
Discuss
Answer: (c).no output

Suggested Topics

Are you eager to expand your knowledge beyond PHP? We've curated a selection of related categories that you might find intriguing.

Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!