Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
minor #32736 [Console] avoid using huge amount of memory when formatt…
…ing long exception (paxal) This PR was submitted for the master branch but it was merged into the 4.4 branch instead (closes #32736). Discussion ---------- [Console] avoid using huge amount of memory when formatting long exception | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | none | License | MIT When formatting exceptions, `preg_split('//u')` is used to iterate over utf8 characters. When the exception is long, the amount of memory used is huge and can reach `memory_limit`. This PR uses a `Generator` to iterate over the string instead of splitting it, thus reducing the amount of memory. Commits ------- 47ffbad Avoid using huge amount of memory when formatting long exception
- Loading branch information