PHP Data Types Multiple Choice Questions
1. You can test the type of any variable with the ..... function.
A) whattype()
B) showtype()
C) gettype()
D) settype()
2. Assigning the empty string (like ' ') to a variable automatically renders it empty.
A) True
B) False
3. If you echo a Boolean variable, the value FALSE displays as a .... and the value TRUE echoes as a .....
A) 0, 1
B) blank string, 2
C) empty variable, 1
D) blank string, 1
4. When a simple data type is casted to an array, an array is created with the original value in the first element.
A) True
B) False
5. String values must be enclosed in ......
A) single quotes
B) double quotes
C) both A and B
D) none of above
6. PHP does not support numbers written in hexadecimal, octal or scientific notation.
A) True
B) False
7. PHP ..... demand that you declare a data type when you create a variable.
A) does
B) does not
8. strval()
A) Accepts a value and converts it into a string array
B) Accepts a value and converts it into an string dictionary
C) Accepts a value and converts it into string equivalent
D) None of above
9. What is the limit of a PHP integer value?
A) 16384
B) 65536
C) 1048576
D) 2147483647
10. PHP considers the following values as False
A) the integer 0
B) the one-character string 0
C) constant NULL
D) both A and B
E) All of Above
Answers