Provides more PHP-native way of dealing with TriGParser results (while I guess every PHP user dealt with foreach probably not every dealt with passing a callable as a handler not to mention writing a lambda).
Makes parsing in chunks easier as a user doesn't has to implement reading in chunks on his/her own. And for large inputs parsing in chunks is far more performant.
Embeds support for streams.
The iterator is implemented in a lazy way (reads data only when they are requested and discards them when they aren't needed) which assures small memory footprint.
The new class serves a few purposes:
TriGParser
results (while I guess every PHP user dealt withforeach
probably not every dealt with passing a callable as a handler not to mention writing a lambda).The iterator is implemented in a lazy way (reads data only when they are requested and discards them when they aren't needed) which assures small memory footprint.