Vidyalelo
PHP · all questions

Operators And Expressions
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

143

Questions

7/8

Page

Pick an option on a question to see the right answer and solution.

What will be the output of the following PHP code ?
<?php
 b = -7;$c =0; 
 a && ++c;
 print a;
?>

Select an option to see the answer and solution.

What will be the output of the following PHP code ?
<?php
$var1 = 3;
print var;
?>

Select an option to see the answer and solution.

What will be the output of the following PHP code ?
<?php
$var1 = 3;
print ++$var++;
?>

Select an option to see the answer and solution.

What will be the output of the following PHP code ?
<?php
j = 1; $k = 2;
print !((k) < (k));
?>

Select an option to see the answer and solution.

What will be the output of the following PHP code ?
<?php
j = 1;$k = 2;
print !(( +  + j) > (k));
?>

Select an option to see the answer and solution.

What will be the output of the following PHP code ?
<?php
j = 1;$k = 2;
print (( +  + j) >! (k));
?>

Select an option to see the answer and solution.

What will be the output of the following PHP code ?
<?php
$a = 0x6db7;
print $a<<6;
?>

Select an option to see the answer and solution.

What will be the output of the following PHP code ?
<?php
$a  =  'a' ;
print $a * 2;
?>

Select an option to see the answer and solution.

What will be the output of the following PHP code ?
<?php
$a  =  '4' ;
print  +  + $a;
?>

Select an option to see the answer and solution.

What will be the output of the following PHP code ?
<?php
$a  =  '12345';
print "qwe{$a}rty";
?>

Select an option to see the answer and solution.

What will be the output of the following PHP code ?
<?php
$a  =  '12345';
print "qwe".$a."rty";
?>

Select an option to see the answer and solution.

What will be the output of the following PHP code ?
<?php
$a  =  '12345';
echo 'qwe{$a}rty';
?>

Select an option to see the answer and solution.

What will be the output of the following PHP code ?
<?php
$a  =  '12345';
echo "qwe$arty";
?>

Select an option to see the answer and solution.

PHP can automatically convert integers to floating point numbers and floating point numbers to integers.

Select an option to see the answer and solution.

In PHP the integer 45 is stored exactly as 45. The floating point number 46.3 could be stored as.

Select an option to see the answer and solution.

What is the output of given statement?
Print 17 % 3;

Select an option to see the answer and solution.

In order to find if a variable holds an actual number or a string containing characters that can be translated into a number you can use:

Select an option to see the answer and solution.

The result of both the below expressions in PHP will be same:
1) 3+4*2
2) (3+4)*2

Select an option to see the answer and solution.

Numbers in PHP can’t be infinitely large or small, there is some minimum and maximum size. If more larger (or smaller) numbers are needed then . . . . . must be used:
1. GPM libraries
2. GMP libraries
3. CBMath
4. BCMath

Select an option to see the answer and solution.

Ceil(-2.1) would be

Select an option to see the answer and solution.