new ExtJsonDecoder(true)]) as $key => $value) { if ($key < $latest) { continue; } // for cut off test you have to uncomment below codes // if($key == 900){ // throw new \Exception('cut off'); // } $chunk[] = $value; if (count($chunk) == 500) { yield $key => $chunk; $chunk = []; } } if (count($chunk) > 0) { yield $key => $chunk; } } }