wp-includes/class-wp-query.php:3666Sets up the next post and iterate current post index.
WP_Post public function next_post() { ++$this->current_post; /** @var WP_Post */ $this->post = $this->posts[ $this->current_post ]; return $this->post; }Introduced in 1.5.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
src/wp-includes/class-wp-query.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.