Q. Which PHP interface must be implemented to make an object iterable with foreach?

  • (A) Iterable
  • (B) Traversable
  • (C) Iterator
  • (D) Arrayable
πŸ’¬ Discuss
βœ… Correct Answer: (C) Iterator
Explanation: Iterator interface allows objects to be used in foreach.
Explanation by: Yami Thakur
Iterator interface allows objects to be used in foreach.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
40
Total Visits
πŸ“½οΈ
7 mo ago
Published
πŸŽ–οΈ
Yami Thakur
Publisher
πŸ“ˆ
85%
Success Rate