PHP Operators
- What will be the output of the following PHP code ?
<?php
$num = '8' ;
print + + $num;
?>
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
The character is type casted to integer before multiplying.
- What will be the output of the following PHP code ?
<?php
$n = 'n' ;
print $n * 8;
?>
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
Characters cannot be multiplied.
- What will be the output of the following PHP code ?
<?php
$n = 0x6db7;
print $n<<8;
?>
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
The output is in decimal.
- What will be the output of the following PHP code ?
<?php
$m = 10;
$n = 11;
$s = 12;
print (( + + $m + $n) >! ($n - $s));
?>
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
Negation of a number is 0.
- What will be the output of the following PHP code ?
<?php
$m = 10; $n = 11; $s = 12;
print !(( + + $m + $n) > ($n - $s));
?>
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
The equation outputs false .