Iterate through results in Doctrine less memory intensive

Code
<?php

use PHPSnippets\Db\Entity\Test;
use 
Doctrine\ORM\Query;

$qb $entityManager->createQueryBuilder();
$qb->select('t')
    ->
from(Test::CLASS, 't')
    ->
where('t.id < :id');

$iterator $qb->getQuery()->iterate(['id' => 4]);

// hydration only happens row by row, making
// iterator less memory intensive
foreach ($iterator as $entity) {
    echo 
$entity[0]->id ', ' $entity[0]->name PHP_EOL;
}
Result
1, foo
2, test
3, bar
Used Versions
PHP 8.2, Laminas MVC 3.2, Symfony 5.2, Laravel 8.28, PHPUnit 9.5, Doctrine ORM 2.8