Is there a way with a PHP Iterator object to sometimes return multiple items from a single item?
For example, suppose I have an array:
$a = ['1','2','3','double 6','4'];
and I want to have an Iterator object that takes this and produces the following items:
- 1
- 2
- 3
- 6
- 6
- 4