Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flags support for pcre_replace_callback(_array) #3958

Closed
wants to merge 1 commit into from

Conversation

nikic
Copy link
Member

@nikic nikic commented Mar 18, 2019

This adds support for the PREG_OFFSET_CAPTURE and PREG_UNMATCHED_AS_NULL flags to preg_replace_callback() and preg_replace_callback_array(). They influence how the passed $matches array looks like.

This addresses https://bugs.php.net/bug.php?id=77094.

@nikic nikic changed the base branch from master to PHP-7.4 March 18, 2019 13:24
@nikic nikic added the Feature label Mar 19, 2019
@nikic
Copy link
Member Author

nikic commented Mar 19, 2019

Merged as 12bcdd6.

@nikic nikic closed this Mar 19, 2019
@cscott
Copy link
Contributor

cscott commented Mar 20, 2019

w00t!

jrfnl added a commit to PHPCompatibility/PHPCompatibility that referenced this pull request Jun 14, 2019
> - PCRE:
>   The preg_replace_callback() and preg_replace_callback_array() functions now
>   accept an additional $flags argument, with support for the
>   PREG_OFFSET_CAPTURE and PREG_UNMATCHED_AS_NULL flags. This influences the
>   format of the matches array passed to to the callback function.

Refs:
* https://github.com/php/php-src/blob/42cc58ff7b2fee1c17a00dc77a4873552ffb577f/UPGRADING#L244
* https://bugs.php.net/bug.php?id=77094
* php/php-src#3958
* php/php-src@12bcdd6
jrfnl added a commit to jrfnl/doc-en that referenced this pull request May 12, 2020
…rray]()

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:
* php/php-src#3958
* https://github.com/php/php-src/blob/2f1398dad934086b605073c51af3118c8eff28b1/UPGRADING#L304-L308
jrfnl added a commit to jrfnl/doc-en that referenced this pull request May 12, 2020
…rray]()

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:
* php/php-src#3958
* https://github.com/php/php-src/blob/2f1398dad934086b605073c51af3118c8eff28b1/UPGRADING#L304-L308
jrfnl added a commit to jrfnl/doc-en that referenced this pull request May 12, 2020
…rray]()

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:
* php/php-src#3958
* https://github.com/php/php-src/blob/2f1398dad934086b605073c51af3118c8eff28b1/UPGRADING#L304-L308
php-pulls pushed a commit to php/doc-en that referenced this pull request May 23, 2020
…rray]()

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:
* php/php-src#3958
* https://github.com/php/php-src/blob/2f1398dad934086b605073c51af3118c8eff28b1/UPGRADING#L304-L308

Patch contributed by jrfnl.


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@349965 c90b9560-bf6c-de11-be94-00142212c4b1
salathe pushed a commit to salathe/phpdoc-en that referenced this pull request Sep 3, 2020
…rray]()

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:
* php/php-src#3958
* https://github.com/php/php-src/blob/2f1398dad934086b605073c51af3118c8eff28b1/UPGRADING#L304-L308

Patch contributed by jrfnl.


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@349965 c90b9560-bf6c-de11-be94-00142212c4b1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants