I need some kind of engine hook to allow this kind of code in the COM

foreach ($container as $child) {
echo $child->name;

The way this works in COM is like this:

foreach fetches the magic iterator property from $container.
The magic iterator is an instance of IEnumXXX, where XXX is
most likely Variant, but could be anything.

It then repeatedly calls $iterator->Next() to fetch the next item.

When done, it releases the $iterator.

I know Marcus implemented iterators for spl, but the concept
there is that the $container itself needs to implement spl interfaces.
The just doesn't fit with the way COM stuff works, and pollutes
the COM object with magic (some COM objects want to handle
method and property accesses by magic themselves).

Can we have a extra handler in the object handlers struct that
returns an object that implements an engine-supported iterator?


Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupphp-internals @
postedOct 7, '03 at 1:48p
activeOct 7, '03 at 1:48p

1 user in discussion

Wez Furlong: 1 post



site design / logo © 2022 Grokbase