nerdexam
Zend

200-710 · Question #184

What is the most efficient way to determine if a key is present in an array, assuming the array has no NULL values?

The correct answer is B. isset($a['key']). See the full explanation below for the reasoning.

Arrays

Question

What is the most efficient way to determine if a key is present in an array, assuming the array has no NULL values?

Options

  • Ain_array('key', array_keys($a))
  • Bisset($a['key'])
  • Carray_key_exists('key', $a)
  • DNone of the above

How the community answered

(33 responses)
  • A
    3% (1)
  • B
    76% (25)
  • C
    6% (2)
  • D
    15% (5)

Topics

#isset#array_key_exists#key lookup#performance

Community Discussion

No community discussion yet for this question.

Full 200-710 Practice