PHP Operators
- What will be the output of the following PHP code ?
<?php
$m = 10; $n = 11; $s = 12;
print !(($m + $s) < ($n - $s));
?>
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
True is 1.
- What will be the output of the following PHP code ?
<?php
$n1 = 13;
print ++$n++;
?>
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
First pre increment is done and the result is a number,thus post increment cannot be performed on it.
- What will be the output of the following PHP code ?
<?php
$n1 = 5;
print $n = ++$n;
?>
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
$n = ++$n returns 1(success).
- What will be the output of the following PHP code ?
<?php
$p = 6; $q = -8; $r = 2;
$s = ++$p && ++$q || ++$r;
echo $s;
echo $p;
?>
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
17
- What will be the output of the following PHP code ?
<?php
$v = 'Mania';
echo "Inter$view";
?>
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
Inter, because $v became $view, which is undefined.