Commerce

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

  1. A. NULL
  2. B. 0
  3. C. an empty string
  4. D. gibberish value
Report Error

It is possible to create a hierarchy of namespaces in PHP.

  1. A. TRUE
  2. B. FALSE
Report Error

All classes in the same namespace or subnamespace don’t have to the declared in the same PHP file.

  1. A. TRUE
  2. B. FALSE
Report Error

Some PHP code might not have a namespace and therefore lives in the . . . . . . namespace.

  1. A. Default
  2. B. Global
  3. C. PRE
  4. D. Automatic
Report Error

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.

  1. A. php
  2. B. grant
  3. C. use
  4. D. label
Report Error

Multiple namespaces cannot be defined in the same file.

  1. A. TRUE
  2. B. FALSE
Report Error

Which of the below namespace declaration is correct?

  1. A. namespace ORA:
  2. B. namespace 1_RA
  3. C. namespace ORA
  4. D. namespace ORA_#
Report Error

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.

  1. A. percent
  2. B. ampersand
  3. C. asterix
  4. D. backslash
Report Error

With the introduction of namespaces, the same function name can be used in multiple places.

  1. A. TRUE
  2. B. FALSE
Report Error

What is the limit of a PHP integer value?

  1. A. 16384
  2. B. 65536
  3. C. 1048576
  4. D. 2147483647
Report Error

strval()

  1. A. Accepts a value and converts it into a string array
  2. B. Accepts a value and converts it into an string dictionary
  3. C. Accepts a value and converts it into string equivalent
  4. D. None of above
Report Error

PHP ..... demand that you declare a data type when you create a variable.

  1. A. does
  2. B. does not
Report Error