Wednesday, 8 October 2014

Hello Everyone...!!!
Multiple choice questions of PHP for PHP developer, PHP interview questions to practice technical interview, web development company in indore,

As every Thursday again i am here with Multiple choice questions of PHP for PHP developers to improve web development skills.

In this particular post i have divided the segments that is Some Questions based on In-Built Functions, some on object tools and some on operators...

PHP Questions 

 

Questions based on in-built functions


Que.1 Which one of the following PHP functions can be used to build a function that accepts any number of arguments?

a) func_get_argv()
b) func_get_argc()
c) get_argv()
d) get_argc()

Que.2 Which one of the following functions can be used to compress a string?

a) zip_compress()
b) zip()
c) compress()
d) gzcompress()

Que.3 Which of the following PHP functions can be used to get the current memory usage?

a) get_usage()
b) get_peak_usage()
c) get_memory_usage()
d) get_memory_peak_usage()

Que.4 Which of the following PHP functions can be used for generating unique id’s?

a) uniqueid()
b) id()
c) md5()
d) mdid()

Que.5 Which one of the following PHP functions can be used to build a function that accepts any number of arguments?

a) func_get_argv()
b) func_get_argc()
c) get_argv()
d) get_argc()


Questions based on Object Tools

 


Que.1 A package is a set of related ___.

a) Objects
b) Classes
c) Programs
d) Functions

Que.2 Which symbol is used to declare nested namespaces?

a) /
b) \
c) .
d) |

Que.3 Which one of the following statements is true for include_once() and require_once()?

a) Both are exactly the same.
b) include_once is used for files where as require_once() is not.
c) Both Handle the errors in the same way.
d) Both do not handle the errors in the same way.

Que.4 Which of the following can you place inside a namespace?

i) classes
ii) functions
iii) variables
a) i)
b) ii)
c) iii)
d) All of the above

Que.5 If I already had a Debug class in the main namespace. What will be the output of the following code?

namespace main;

use com\getinstance\util\Debug;

<pre lang="php" cssfile="hk1_style" >

class Debug {

static function helloWorld() {

print "hello from main\Debug";

}

}


Debug::helloWorld();

a) Error
b) hello from main
c) hello from main\Debug
d) Debug


Questions based on operators

 



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

<?php

$i = 0; $j = 1; $k = 2;

print !(($i + $k) < ($j - $k));

?>

a) 1
b) true
c) false
d) 0


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

<?php

$i = 0;$j = 1;$k = 2;

print !(( + + $i + $j) > ($j - $k));

?>

a) 1
b) no output
c) error
d) 0


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

<?php

$i = 0;$j = 1;$k = 2;

print (( + + $i + $j) >! ($j - $k));

?>

a) 1
b) no output
c) error
d) 0

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

<?php

$a = 0x6db7;

print $a<<6;

?>

a) 1797568
b) no output
c) error
d) 0x6dc0
View Answer

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

<?php

$a = 'a' ;

print $a * 2;

?>

a) 192
b) 2
c) error
d) 0

Answersheet of these Questions will be available Tomorrow


Want more Questions....??? CLICK THE LINKS BELOW



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


0 comments:

Post a Comment

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