Skip to content

Reduce regex backtracking in phpinfo.phpt #16087

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 1 commit into from
Sep 27, 2024

Conversation

iluuu1994
Copy link
Member

On NixOS, the output of phpinfo() can get very large, causing us to run into the backtracking limit. Lazy matching for .*/.+ can help reduce backtracking.

On NixOS, the output of phpinfo() can get very large, causing us to run into the
backtracking limit. Lazy matching for .*/.+ can help reduce backtracking.
@iluuu1994
Copy link
Member Author

iluuu1994 commented Sep 27, 2024

Maybe this is something that should be adjusted for %a/%A in run-tests.php on master. Since we're not using the capture groups there should not be a behavioral difference. .*? should always be better in terms of backtracking.

@iluuu1994 iluuu1994 merged commit c4c45da into php:PHP-8.2 Sep 27, 2024
7 of 8 checks passed
iluuu1994 added a commit to iluuu1994/php-src that referenced this pull request Sep 27, 2024
This reduces backtracking, which should improve performance and avoid hitting
the backtrack limit in tests with a large output.

See php#16087
iluuu1994 added a commit that referenced this pull request Oct 7, 2024
This reduces backtracking, which should improve performance and avoid hitting
the backtrack limit in tests with a large output.

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

Successfully merging this pull request may close these issues.

1 participant