nerdexam
Zend

200-710 · Question #64

QUESTION 67 Which interfaces could class C implement in order to allow each statement in the following code to work? (Choose 2) $obj = new C(); foreach ($obj as $x => $y) { echo $x, $y; }

The correct answer is A. Iterator C. IteratorAggregate. See the full explanation below for the reasoning.

Question

QUESTION 67 Which interfaces could class C implement in order to allow each statement in the following code to work? (Choose 2) $obj = new C(); foreach ($obj as $x => $y) { echo $x, $y; }

Options

  • AIterator
  • BArrayAccess
  • CIteratorAggregate
  • DArrayObject

How the community answered

(57 responses)
  • A
    75% (43)
  • B
    18% (10)
  • D
    7% (4)

Community Discussion

No community discussion yet for this question.

Full 200-710 Practice