From 1b4bb0bb6b803d458ca6b1aaaebfd3afc3ed066a Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Mon, 7 Oct 2024 14:01:54 +0200 Subject: [PATCH] Make %a/%A placeholders in tests lazy (#16088) This reduces backtracking, which should improve performance and avoid hitting the backtrack limit in tests with a large output. See https://github.com/php/php-src/pull/16087 --- run-tests.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/run-tests.php b/run-tests.php index 0dee752d320..bd03a7f882a 100755 --- a/run-tests.php +++ b/run-tests.php @@ -2872,8 +2872,8 @@ function expectf_to_regex(?string $wanted): string '%e' => preg_quote(DIRECTORY_SEPARATOR, '/'), '%s' => '[^\r\n]+', '%S' => '[^\r\n]*', - '%a' => '.+', - '%A' => '.*', + '%a' => '.+?', + '%A' => '.*?', '%w' => '\s*', '%i' => '[+-]?\d+', '%d' => '\d+',