Thursday, July 30, 2015

PHP Test Question



Question :1 There are two objects- $product1 = new Shop(); $product2 = new Shop(); Which one of the following statements is right about them?
  • $product1 and $product2 are same objects of the different type generated from a single class.
  • $product1 and $product2 are different objects of the different type generated from a single class.
  • $product1 and $product2 are same objects of the same type generated from a single class.
  • $product1 and $product2 are different objects of the same type generated from a single class.
Answer: $product1 and $product2 are different objects of the same type generated from a single class.

Which type of array allows you to use textual keys so that array indices can be more descriptive?
  • Key
  • All of these
  • Textual
  • Associative
Answer: Associative
What is the difference between the include() and require() language constructs?
  • They handle file paths differently.
  • There is no difference.
  • They handle failure differently.
  • None of these.
Answer: They handle failure differently.




What does delete() function do?
  • Delete directories.
  • Delete files.
  • Delete files and directories.
  • There is no such function.
Answer: There is no such function.
What will be the output of the following code? $a$a = 1; $b$b = 2; echo "$a$a + $b$b";
  • $a$a$b$b
  • Error, $ cannot be used inside variable names
  • 3
Answer: Error, $ cannot be used inside variable names
True or False: There is no difference in using the following 2 examples: echo('string'); echo 'string';
  • False
  • True
  • It depends on the server environment
Answer: True
What does the following output? echo (5 % 3);
  • 2
  • 15
  • 1
  • None of these
Answer: 2



What is meaning of PEAR?
  • PHP Extension and Application Register
  • PHP Extension and Application Repository
  • PHP Execution and Application Repository
Answer: PHP Extension and Application Repository
What is the GD Library?
  • it's add a dozen of special new $_GLOBAL variables that gives principally informations on the user (localization, common social media cookies, etc...) - (Global iDentification)
  • It is a library that gives the PHP the capability to create and manipulate image files. - (Gif Draw)
  • It is a library that gives the PHP the capability to access and create virtual domains. - (Generated Domain)
Answer: It is a library that gives the PHP the capability to create and manipulate image files. - (Gif Draw)



No comments:

Post a Comment