Skip to content

Commit 1b4bb0b

Browse files
authored
Make %a/%A placeholders in tests lazy (php#16088)
This reduces backtracking, which should improve performance and avoid hitting the backtrack limit in tests with a large output. See php#16087
1 parent a74eb24 commit 1b4bb0b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

run-tests.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2872,8 +2872,8 @@ function expectf_to_regex(?string $wanted): string
28722872
'%e' => preg_quote(DIRECTORY_SEPARATOR, '/'),
28732873
'%s' => '[^\r\n]+',
28742874
'%S' => '[^\r\n]*',
2875-
'%a' => '.+',
2876-
'%A' => '.*',
2875+
'%a' => '.+?',
2876+
'%A' => '.*?',
28772877
'%w' => '\s*',
28782878
'%i' => '[+-]?\d+',
28792879
'%d' => '\d+',

0 commit comments

Comments
 (0)