Thursday 25 September 2014


Hello everyone...!!!
PHP technical interview Questions And answers for PHP developers, PHP programming multiple choice questions,


I got too many mails in my Inbox about why i didn't provide PHP test Questions yesterday as every Thursday.. Sorry Guys i was not able to do that.

That's why today i am here with PHP Questions.But today i have changed something, No theory only technical questions which will help you to prepare for technical interviews and will also enhance the web development skills of PHP developers.

Here we go....

PHP Questions 

 

Que.1 What will be the output of the following PHP code ?

<?php

$i = 0;

for ($i)

{

print $i;

}

?>

a) 0
b) infinite loop
c) no output
d) error




Que.2 . What will be the output of the following PHP code ?


<?php

$a = "1";

switch($a)

{

case 1:

break;

print "hi";

case 2:

print "hello";

break;

default:

print "hi1";

}

?>

a) hihellohi1
b) no output
c) hihi1
d) hi1



Que.3 What will be the output of the following PHP code ?


<?php

$x = 0;

if ($x == 1)

if ($x >= 0)

print "true";

else

rint "false";

?>

a) true
b) false
c) error
d) No output



Que.4 What will be the output of the following PHP code ?


<?php

$i = 0;

while ($i = 10)

{

print "hi";

}

print "hello";

?>

a) hello
b) infinite loop
c) hihello
d) error


Que.5 What will be the output of the following PHP code ?


<?php

for ($x = 0; $x <= 10; print ++$x)

{

print ++$x;

}

?>

a) 123456789101112
b) 12345678910
c) 1234567891011
d) infinite loop


Que.6 What will be the output of the following PHP code ?


<?php

switch($b)

{

case 2:

print "hello";

break;

case 1:

print "hi";

break;

}

?>

a) hello
b) hi
c) no output
d) error


Que.7 . What will be the output of the following PHP code ?


<?php

$i = 5;

while (--$i > 0 && ++$i)

{

print $i;

}

?>

a) 5
b) 555555555…infinitely
c) 54321
d) error


Que.8 What will be the output of the following PHP code ?


<?php

$a = 1;

if (echo $a)

print "True";

else

print "False";

?>

a) true
b) false
c) error
d) No output


Que.9 What will be the output of the following PHP code ?


<?php

for ($i++; $i == 1; $i = 2)

print "In for loop ";

print "After loop\n";


?>

a) In for loop
b) After for loop
c) In for loopAfter for loop
d) infinite loop


Que. 10 What will be the output of the following PHP code ?


<?php

$a = "a";

if ($a)

print "all";

else

print "some";

?>

a) all
b) some
c) error
d) no output


Answer-sheet of these questions will be available Tomorrow

For more questions CLICK THE LINKS BELOW


Share your experience or any suggestion with us .. VIA COMMENTS



1 comment:

  1. outsourcingall.com "Usually I never comment on blogs but your article is so convincing that I never stop myself to say something about it.
    This paragraph gives clear idea for the new viewers of blogging, Thanks you. You’re doing a great job Man, Keep it up.
    web development training

    ReplyDelete

  • RSS
  • Delicious
  • Digg
  • Facebook
  • Twitter
  • Linkedin
  • Youtube