halaxa / json-machine

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

error when foreach #59

Closed quantrpeter closed 2 years ago

quantrpeter commented 3 years ago

Hi if i "$json = JsonMachine::fromFile($_FILES["file"]["tmp_name"]);" a large file and foreach to loop it, it crash

foreach ($json as $e) {
    $element = (object)$e;
}

If i add "var_dump($element);" inside the foreach loop, it back to work. why?

thanks Peter

halaxa commented 3 years ago

Hi, can you please provide the json structure and the error message? Thanks

halaxa commented 2 years ago

Closing for now. Feel free to reopen if the problem persists.