nerdexam
Zend

200-710 · Question #191

What will be the output of the following code? ``php $a = array(0, 1, 2 => array(3, 4)); $a[] = array(4, 5); echo count ($a, 1); ``

The correct answer is C. 8. See the full explanation below for the reasoning.

Arrays

Question

What will be the output of the following code?
$a = array(0, 1, 2 => array(3, 4));
$a[] = array(4, 5);
echo count ($a, 1);

Options

  • A4
  • B5
  • C8
  • DNone of the above

How the community answered

(63 responses)
  • A
    5% (3)
  • B
    6% (4)
  • C
    73% (46)
  • D
    16% (10)

Topics

#count()#COUNT_RECURSIVE#nested arrays#multidimensional arrays

Community Discussion

No community discussion yet for this question.

Full 200-710 Practice