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)- A75% (43)
- B18% (10)
- D7% (4)
Community Discussion
No community discussion yet for this question.