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
Subscribe
Login
0 Comments
Inline Feedbacks
View all comments