CEITR Paper |   604

CEITR Paper

                                                         CEITR Previous Paper

PHP - Multiple Choice Questions 


1. Trace the odd data type
a. floats
b. integer
c. doubles
d. Real number

2. Which of the folowing are valid float values?
a. 4.5678
b. 4.0
c. 7e4
d. All of above

3. In php string data are
a. delimited by single quote
b. delimited by double quote
c. delimited by <<< identifier
d. All of above

4. Which of the following delimiting method is known as string Interpolation
a. delimited by single quote
b. delimited by double quote
c. delimited by <<< identifier
d. All of above

5. Which datatypes are treaded as arrays
a. Integer
b. Float
c. String
d. Booleans

6. Which of following are compound data type?
a. Array
b. Objects
c. Both
d. None

7. Casting operator introduced in PHP 6 is
a. (array)
b. (int64)
c. (real) or (double) or (float)
d. (object)

8. 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

9. Identify the invalid identifier
a. my-function
b. size
c. –some word
d. This&that

10. Which of folowiing variable assignment is 'by value' assignment in PHP
a. $value1= $value?
b. $value1= & $value?
c. $value1= & $value?
d. None

11. Identify the variable scope that is not supported by PHP
a. Local variables
b. Function parameters
c. Hidden variables
d. Global variables

12. The output of ofllowing script would be
$somerar=15;
function ad it () {
GLOBAL $somevar;
$somerar++ ;
echo "somerar is $somerar";
}
addit ();

a. somerar is 15
b. somerar is 16
c. somerar is 1
d. somerar is $ somerar

13. 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

14. The left association operator % is used in PHP for
a. percentage
b. bitwise or
c. division
d. modulus

15. The left associative dot operator (.) is used in PHP for
a. multiplication
b. concatenation
c. separate object and its member
d. delimeter

16. Trace the false statement
a. Any code found within an included file will inherit the variable scope of the location of its caller
b. Because the included code will be embedded in a PHP execution block, the PHP execution block, the PHP escape tags (<?php?>Wink aren't required on the file to be included
c. For the inclusion of remote files the allow-url-pope must be enabled ad URL wrapper must be supported
d. Including a file produces the same result as copying the data from the file specified into the location in which the statement appears.

17. 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

18. 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

19. On failure of which statement the script execution stops displaying error/warning message?
a. rinclude ()
b. require ()
c. both of above
d. None of above

20. 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

feedback