Open MarkBaker opened 9 years ago
Does
for value in iterator(collection) {
this->add(value);
}
work?
Bingo, that works thanks.... is it documented anywhere?
I think it's indeed missing in the official documentation, so the only "documentation" would unfortunately be a test case and the implementation for it.
Zephir 0.7.1b
I've created a simple iterable class:
and a simple PHP script to test it
PHP is able to iterate happily over each instance of the collection, so there's no problem there; but as soon as I call the
merge()
method which tries to iterate internally over the passed argumentI get a fatal error from the collection
The stack trace isn't particularly helpful
But it seems that Zephir can't iterate over classes created in Zephir as iterable, even though a basic PHP script does see them as iterable.... or am I missing something fundamental?