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

Use generator in iterator extraction #97

Open
chanmix51 opened this issue May 29, 2017 · 1 comment
Open

Use generator in iterator extraction #97

chanmix51 opened this issue May 29, 2017 · 1 comment

Comments

@chanmix51
Copy link
Member

The extract() method in result iterator stores all the result in an array, this uses a lot of memory. It would be better to use a generator here (PHP 5.5).

@chanmix51
Copy link
Member Author

To sum it up: the result iterator proposes a extract() method to materialize the result set as an array (to use mainly with json_encode). Why then use extract if an iterator (or a generator) is needed? Why not directly use the iterator?

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

No branches or pull requests

1 participant