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

[6.x] preg_replace_array remove needless foreach #31499

Closed
wants to merge 1 commit into from
Closed

[6.x] preg_replace_array remove needless foreach #31499

wants to merge 1 commit into from

Conversation

dmitryuk
Copy link
Contributor

Remove needless foreach from preg_replace_array helper.

@GrahamCampbell
Copy link
Member

Sorry but this isn't correct. The foreach is doing the job of handling the two different cases:

  1. The array is empty.
  2. The array is of size at least 1.

Your code doesn't handle the empty case properly.

@SjorsO
Copy link
Contributor

SjorsO commented Feb 17, 2020

@dmitryuk I was writing some tests for the preg_replace_array, and turns out you were right, the foreach is unnecessary. I've opened a new PR #31504

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

3 participants