CommerceBasic Php MCQs
Practice Basic Php MCQs for competitive exams.
Basic Php MCQs
Practice questions from this topic.
The value of __NAMESPACE__ is a string that contains the current namespace name. In global, un-namespaced code, it contains . . . . . .
- A. NULL
- B. 0
- C. an empty string
- D. gibberish value
Correct Answer: C
It is possible to create a hierarchy of namespaces in PHP.
- A. TRUE
- B. FALSE
Correct Answer: B
All classes in the same namespace or subnamespace don’t have to the declared in the same PHP file.
- A. TRUE
- B. FALSE
Correct Answer: A
Some PHP code might not have a namespace and therefore lives in the . . . . . . namespace.
- A. Default
- B. Global
- C. PRE
- D. Automatic
Correct Answer: B
As the namespace size grows, using namespaces can become a little repetitious, but PHP also provides the . . . . . statement, which allows you to alias a specific namespace.
- A. php
- B. grant
- C. use
- D. label
Correct Answer: C
Multiple namespaces cannot be defined in the same file.
- A. TRUE
- B. FALSE
Correct Answer: B
Which of the below namespace declaration is correct?
- A. namespace ORA:
- B. namespace 1_RA
- C. namespace ORA
- D. namespace ORA_#
Correct Answer: C
Within a namespace, for accessing the built-in PHP classes you can prefix the class name with a . . . . . and let PHP look in the global class list.
- A. percent
- B. ampersand
- C. asterix
- D. backslash
Correct Answer: D
With the introduction of namespaces, the same function name can be used in multiple places.
- A. TRUE
- B. FALSE
Correct Answer: A
What is the limit of a PHP integer value?
- A. 16384
- B. 65536
- C. 1048576
- D. 2147483647
Correct Answer: D
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
Correct Answer: C
PHP ..... demand that you declare a data type when you create a variable.
- A. does
- B. does not
Correct Answer: B