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

Add a tap function #95

Merged
merged 6 commits into from
Oct 11, 2023
Merged

Add a tap function #95

merged 6 commits into from
Oct 11, 2023

Conversation

athrawes
Copy link
Contributor

@athrawes athrawes commented Sep 1, 2023

This function lazily performs a side effect for each item in an iterable, without changing the keys/values of said iterable.

This is useful for things like logging, saving partial results to a database, or any other side effects which should not change the outcome of the full iteration pipeline.

This function lazily performs a side effect for each item in an iterable,
without changing the keys/values of said iterable.

This is useful for things like logging, saving partial results to a database, or
any other side effects which should not change the outcome of the full iteration
pipeline.
src/iter.php Outdated Show resolved Hide resolved
@nikic
Copy link
Owner

nikic commented Sep 16, 2023

Can you please also add a test for the function and mention it in the README?

@nikic nikic merged commit 6e0498c into nikic:master Oct 11, 2023
6 checks passed
@athrawes athrawes deleted the feature/iter-tap branch October 11, 2023 20:03
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

Successfully merging this pull request may close these issues.

None yet

2 participants