Php Interview Questions & Answers: part5



Php Interview QUESTIONS AND ANSWERS :: part5 : 1 to 5

Following PHP Multiple choice objective type questions and answers will help you in many software compnaies written examinations and inteview 2015 :

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

Array ( [1] => apple [0] => mango [2] => peach [3] => pear )
Array ( [0] => apple [1] => mango [2] => peach [3] => pear )
Error
Array ( [1] => apple [0] => mango [3] => peach [2] => pear )

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

Array ( [0] => picture1.JPG [1] => Picture10.jpg [2] => picture2.jpg [3] => picture20.jpg )
Array ( [0] => picture1.JPG [1] => picture2.jpg [2] => Picture10.jpg [3] => picture20.jpg )
Array ( [0] => Picture10.jpg [1] => picture1.JPG [2] => picture2.jpg [3] => picture20.jpg )
Array ( [0] => Picture10.jpg [1] => picture1.JPG [2] => picture20.jpg [3] => picture2.jpg )

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

Array ( [0] => A [1] => J [2] => Q [3] => K [4] => 2 [5] => 3 [6] => 4 [7] => 5 [8] => 6 [9] => 7 [10] => 8 [11] => 9 [12] => 10 )
Array ( [0] => A [1] => 2 [2] => J [3] => 3 [4] => Q [5] => 4 [6] => K [7] => 5 [8] => 6 [9] => 7 [10] => 8 [11] => 9 [12] => 10 )
Error
Array ( [0] => 2 [1] => 3 [2] => 4 [3] => 5 [4] => 6 [5] => 7 [6] => 8 [7] => 9 [8] => 10 [9] => A [10] => J [11] => Q [12] => K )

4.Which one of the following property scopes is not supported by PHP?

friendly
final
public
static

5.Which one of the following can be used to instantiate an object in PHP assuming class name to be Foo?

$obj = new $foo;
$obj = new foo;
$obj = new foo ();
obj = new foo ();

More Php Interview QUESTIONS AND ANSWERS available in next pages

    Health is the greatest gift, contentment is the greatest wealth -Buddha
Innovation distinguishes between a leader and a follower.-Steve Jobs