Exam4Training

Which interfaces could class C implement in order to allow each statement in the following code to work? (Choose 2)

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;
A . Iterator
B . ArrayAccess
C . lteratorAggregate
D . ArrayObject

Answer: A, C

Exit mobile version