<?php
$http = new HTTP_Request2();
$pi = new PagingJsonIterator(
    $http,
    'http://jira.example.com/rest/api/2/search'
    . '?startAt={startAt}'
    . '&maxResults={pageSize}'
    . '&fields=key'
    ),
    50
);
foreach ($pi as $issue) {
    echo $issue->key . "\n";
}
?>
