1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

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
This commit is contained in:
Ilija Tovilo
2024-10-07 14:01:54 +02:00
committed by GitHub
parent a74eb24e69
commit 1b4bb0bb6b

View File

@@ -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+',