200-710

200-710 practice questions, page 2 of 4, with answer review and explanations.

Question 6

You want to parse a URL into its single parts. Which function do you choose?

  1. parse_url()
  2. url_parse(0
  3. get_url_parts()
  4. geturlparts()

Question 7

What is the output of the following code?

  1. This is text
  2. $text
  3. $text1
  4. $text2

Question 8

What function can be used to retrieve an array of current options for a stream context?

  1. stream_get_options()
  2. stream_context_get_default()
  3. stream_context_get_options()
  4. The ‘options’ element of the stream_get_meta_data() return value

Question 9

Given the following array: Which function will remove the value 28 from $a?

  1. array_shift()
  2. array_pop()
  3. array_pull()
  4. array_unshift()

Question 10

When would you use classes and when would you use namespaces?

  1. Use classes to encapsulate code and represent objects, and namespaces to avoid symbol name collisions
  2. Use classes for performance-sensitive code, and namespaces when readability matters more
  3. Use namespaces for performance-sensitive code, and classes when readability matters more
  4. Always use them; namespaces as always superior to classes