PHP 20

COEP
Lets Crack Online Exam

IT Interview Exam Paper: PHP 20

Subject: PHP 20

Part 20: List for questions and answers of PHP

 

Q1. mysql_connect( ) does not take following parameter

a) database host

b) user ID

c) password

d) database name

 

Q2. Which of the folowing are valid float values?

a) 4.5678

b) 4.0

c) 7e4

d) All of above

 

Q3. In php string data are

a) delimited by single quote

b) delimited by double quote

c) delimited by < << identifier

d) All of above

 

Q4. Which of the following delimiting method is known as string Interpolation

a) 4.5678

b) 4.0

c) 7e4

d) All of above

 

Q5. Which of following are compound data type?

a) Array

b) Objects

c) Both

d) None of above

 

Q6. Casting operator introduced in PHP 6 is

a) (array)

b) (int64)

c) (real) or (double) or (float)

d) (object) 

 

Q7. When defining identifier in PHP you should remember that

a) Identifier are case sensitive. So $result is different than $ result

b) Identifiers can be any length

c) Both of above

d) None of above

 

Q8. Identify the invalid identifier

a) my-function

b) size

c) –some word

d) This&that

 

Q9. Which of folowiing variable assignment is ‘by value’ assignment in PHP

a) $value1= $value?

b) $value1= & $value?

c) $value1= & $value?

d) None of above

 

Q10. <?php $x=array(4,2,5,1,4,5,3,4); $y=array_count_values($x); echo count($y); ?>

a) 8

b) 5

c) 27

d) 28

 

Q11. <?php $color=array(“red”,”yellow”,”white”); $x=in_array(“black”,$color); if($x==0) echo “good bye”; if($x==1) echo “Hello”; ?>

a) Hello

b) Error

c) good bye

d) None of the above

 

Q12. Identify the variable scope that is not supported by PHP

a) Local variables

b) Function parameters

c) Hidden variables

d) Global variables 

 

Q13. Variable scope on which a variable does not loose its value when the function exists and use that value if the function is called again is:

a) Local

b) function parameter

c) static

d) None of above

 

Q14. The left association operator % is used in PHP for

a) percentage

b) bitwise or

c) division

d) modulus

 

Q15. The left associative dot operator (.) is used in PHP for

a) multiplication

b) concatenation

c) separate object and its member

d) delimeter

 

Q16. Which of the following functions require the allow-url-fopen must be enabled?

a) include()

b) require()

c) both of above

d) None of above

 

Q17. Which function includes the specified file even the statement evaluates to false in which block the function is placed.

a) include()

b) require()

c) both of above

d) None of above

 

Q18. On failure of which statement the script execution stops displaying error/warning message?

a) include()

b) require()

c) both of above

d) None of above 

 

Q19. Trace the function that does continue the script execution even if the file inclusion fails

a) include()

b) require()

c) both of above

d) None of above

 

Q20. Which of the following function is used to change the root directory in PHP?

a) choot()

b) change_root()

c) cd_root()

d) cd_r() 

 

Part 20: List for questions and answers of PHP

 

Q1. Answer: d

 

Q2. Answer: d

 

Q3. Answer: d

 

Q4. Answer: d

 

Q5. Answer: c

 

Q6. Answer: b

 

Q7. Answer: c

 

Q8. Answer: d

 

Q9. Answer: a

 

Q10. Answer: b

 

Q11. Answer: c

 

Q12. Answer: c

 

Q13. Answer: b

 

Q14. Answer: d

 

Q15. Answer: b

 

Q16. Answer: c

 

Q17. Answer: b

 

Q18. Answer: b

 

Q19. Answer: a

 

Q20. Answer: a