Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GoCardlessPro\Core\Paginator does not work with iterator_to_array() #33

Open
oschonrock opened this issue Oct 19, 2017 · 1 comment
Open

Comments

@oschonrock
Copy link

$paginator = $client->events()->all();
foreach ( iterator_to_array($paginator) as $record)
{
 // do sth with record...does not work correctly
 //  ie you only get the first "page" ie 50 records by default.
}

iterator_to_array() should be effectively the same as:

    $records = [];
    foreach ($paginator as $record)
    {
      $records[] = $record;
    }

But it is not. (PHP v 5.6.29)

@oschonrock oschonrock changed the title GoCardlessPro\Core\Paginator does work with iterator_to_array() GoCardlessPro\Core\Paginator does not work with iterator_to_array() Oct 30, 2017
@timrogers
Copy link

I'm not familiar with iterator_to_array. How commonly is it used? Presumably if this is broken, then our Paginator is implemented in a way which is somehow incompatible with Iterable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants