halaxa / json-machine

Efficient, easy-to-use, and fast PHP JSON stream parser
Apache License 2.0
1.1k stars 65 forks source link

JsonMachine return blank #56

Closed mitmelon closed 3 years ago

mitmelon commented 3 years ago

Is it possible for Jsonmachine to return a response without using foreach?

halaxa commented 3 years ago

I'm not sure if I understand but you can always use Generator API to access the results without foreach. See https://www.php.net/manual/en/class.generator.php, more specifically methods rewind(), valid(), next(), key() and current()