ext-php-rs
ext-php-rs copied to clipboard
Iterator from Rust
Is there an example available to show how to implement an iterator for a Rust object that would work in the PHP side using foreach? Just naively implementing the Iterator interface didn't work, since PHP does not know about it. Any pointers would be appreciated.
Basically, I need this to work for my Rust object:
foreach($records as $key => $rec) {
...
}