aboutsummaryrefslogtreecommitdiffhomepage
path: root/docs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-08-17 03:23:52 +0900
committernsfisis <nsfisis@gmail.com>2026-08-17 03:23:52 +0900
commitabffae07ed350ebb1de98edd2ae246ccddfa6085 (patch)
tree6c917cc08e39ad95078505951bdea4b9ae538630 /docs
parent8b57e90f5c563bbc1a6060d9f5e94b5d3cd91324 (diff)
downloadphp-shirabe-abffae07ed350ebb1de98edd2ae246ccddfa6085.tar.gz
php-shirabe-abffae07ed350ebb1de98edd2ae246ccddfa6085.tar.zst
php-shirabe-abffae07ed350ebb1de98edd2ae246ccddfa6085.zip
refactor(preg): merge preg_match_all_offset_capture2() into its sibling
The two functions ran the same search and differed only in how they reported a non-participating group: one as ("", 0) in a bespoke struct, the other as (null, -1) in a capture-key map. Neither shape covered both callers, because PHP reaches preg_match_all() with different flags from each: Preg::matchAllWithOffsets() always ORs in PREG_UNMATCHED_AS_NULL, while OutputFormatter::formatAndWrap() passes PREG_OFFSET_CAPTURE alone. Keep the capture-key map, which also exposes named groups, and take the flags that decide between null and "" for an unmatched group. The offset is -1 either way, so the ("", 0) approximation is gone. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'docs')
0 files changed, 0 insertions, 0 deletions