• HOME
  • QUIZ
  • CONTACT US
EXAMIANS
  • COMPUTER
  • CURRENT AFFAIRS
  • ENGINEERING
    • Chemical Engineering
    • Civil Engineering
    • Computer Engineering
    • Electrical Engineering
    • Mechanical Engineering
  • ENGLISH GRAMMAR
  • GK
  • GUJARATI MCQ

PHP Operators and Expressions

PHP Operators and Expressions
What will be the output of the following PHP code ?
$x = 4;
$y = 3;
function fun($x = 3, $y = 4) {
$z = $x+$y/$y+$x;
echo "$z";
}
echo $x;
echo $y;
echo $z;
fun($x, $y);

349
43
943
439

ANSWER DOWNLOAD EXAMIANS APP

PHP Operators and Expressions
What will be the output of the following PHP code ?
$color1 = "red";
$color2 = "1";
$color3 = "grey";
echo "$color1" + "$color2" . "$color3";

red1grey
1grey
grey
0

ANSWER DOWNLOAD EXAMIANS APP

PHP Operators and Expressions
What will be the output of the following PHP code ?
$4four = 4;
$3three = 3;
$2two = 2;
echo $4four + $3three / $2two - 1;

4.5
3.5
7
Error

ANSWER DOWNLOAD EXAMIANS APP

PHP Operators and Expressions
What will be the output of the following PHP code ?
$i = 0;
while (++$i && --$i) {
print $i;
}

1234567891011121314….infinitely
01234567891011121314…infinitely
error
no output

ANSWER DOWNLOAD EXAMIANS APP

PHP Operators and Expressions
What will be the output of the following PHP code ?
class myObject { }
define('myObject::CONSTANT', 'test');
echo myObject::CONSTANT;

myObject::CONSTANT
error
no output
test

ANSWER DOWNLOAD EXAMIANS APP

PHP Operators and Expressions
What will be the output of the following PHP code ?
$x = 4;
$y = 3$z = 1;
$z = $z + $x + $y;
echo "$z";

15
8
1
$z

ANSWER DOWNLOAD EXAMIANS APP
MORE MCQ ON PHP Operators and Expressions

DOWNLOAD APP

  • APPLE
    from app store
  • ANDROID
    from play store

SEARCH

LOGIN HERE


  • GOOGLE

FIND US

  • 1.70K
    FOLLOW US
  • EXAMIANSSTUDY FOR YOUR DREAMS.
  • SUPPORT :SUPPORT EMAIL ACCOUNT : examians@yahoo.com

OTHER WEBSITES

  • GUJARATI MCQ
  • ACCOUNTIANS

QUICK LINKS

  • HOME
  • QUIZ
  • PRIVACY POLICY
  • DISCLAIMER
  • TERMS & CONDITIONS
  • CONTACT US
↑