Skip to content

PHP7 compatibility: Avoid using 'e' modifier in preg_replace #42

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

Merged
merged 2 commits into from
Sep 22, 2016

Conversation

petrkotek
Copy link
Contributor

There is already plenty of PRs trying to fix this: #32 #36, #39, and #41.

I liked the best solution from #41, however I decided to polish it a bit and add test coverage to demostrate that it still works the same.

* @return string The HTML representation of the string.
*/
function fixSpaces($spaces='')
private function fixSpaces(array $matches)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this method is used only by the callback above, so it can be private

@chrisboulton
Copy link
Owner

🙇 thanks

@chrisboulton chrisboulton merged commit f5737a6 into chrisboulton:master Sep 22, 2016
@petrkotek petrkotek deleted the php7-compatibility branch September 22, 2016 20:59
lazyfrosch added a commit to lazyfrosch/php-diff that referenced this pull request May 9, 2018
It avoids breaking the callback when no spaces are to be counted.

This is a fixup for 2900dd9 (chrisboulton#42)
lazyfrosch added a commit to lazyfrosch/php-diff that referenced this pull request May 9, 2018
It avoids breaking the callback when no spaces are to be counted.

This is a fixup for 2900dd9 (chrisboulton#42)
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.

2 participants