From cd8ca758fe6e111d39c6464e99ba19dfb8dcd91e Mon Sep 17 00:00:00 2001 From: jrfnl Date: Tue, 12 May 2020 15:58:42 +0200 Subject: [PATCH] PHP 7.4: PCRE: document new $flags param for preg_replace_callback[_array]() The PHP 7.4 `$flags` parameter as added to the `preg_replace_callback()` and `preg_replace_callback_array()` function was not yet included in the documentation. In this PR, I'm * Adding the parameter to the function signature. * Adding minimal parameter documentation with a reference to the more detailed explanation in the parameter documentation of the [`preg_match()`](https://www.php.net/manual/en/function.preg-match.php) function. * Adding a changelog entry for the parameter to each function. Refs: * https://github.com/php/php-src/pull/3958 * https://github.com/php/php-src/blob/2f1398dad934086b605073c51af3118c8eff28b1/UPGRADING#L304-L308 --- .../functions/preg-replace-callback-array.xml | 39 +++++++++++++++++++ .../pcre/functions/preg-replace-callback.xml | 27 +++++++++++-- 2 files changed, 63 insertions(+), 3 deletions(-) diff --git a/reference/pcre/functions/preg-replace-callback-array.xml b/reference/pcre/functions/preg-replace-callback-array.xml index 9d287085bef3..12dd1668e694 100644 --- a/reference/pcre/functions/preg-replace-callback-array.xml +++ b/reference/pcre/functions/preg-replace-callback-array.xml @@ -14,6 +14,7 @@ mixedsubject intlimit-1 intcount + intflags0 The behavior of this function is similar to @@ -61,6 +62,20 @@ + + flags + + + flags can be a combination of the + PREG_OFFSET_CAPTURE and + PREG_UNMATCHED_AS_NULL flags, which influence the + format of the matches array. + See the description in + preg_match() + for more details. + + + @@ -78,6 +93,30 @@ + + &reftitle.changelog; + + + + + + &Version; + &Description; + + + + + 7.4.0 + + The flags parameter was added. + + + + + + + + &reftitle.examples; diff --git a/reference/pcre/functions/preg-replace-callback.xml b/reference/pcre/functions/preg-replace-callback.xml index 32c884f042d5..1934949b676e 100644 --- a/reference/pcre/functions/preg-replace-callback.xml +++ b/reference/pcre/functions/preg-replace-callback.xml @@ -15,6 +15,7 @@ mixedsubject intlimit-1 intcount + intflags0 The behavior of this function is almost identical to @@ -64,7 +65,7 @@ - <function>preg_replace_callback</function> and + <title><function>preg_replace_callback</function> and anonymous function + + flags + + + flags can be a combination of the + PREG_OFFSET_CAPTURE and + PREG_UNMATCHED_AS_NULL flags, which influence the + format of the matches array. + See the description in + preg_match() + for more details. + + + @@ -131,7 +146,7 @@ fclose($fp); If matches are found, the new subject will be returned, otherwise - subject will be returned unchanged. + subject will be returned unchanged. @@ -147,10 +162,16 @@ fclose($fp); + + 7.4.0 + + The flags parameter was added. + + 5.1.0 - The count parameter was added + The count parameter was added.