Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

RFC: Implement preg_replace_callback_array function#1171

Merged
php-pulls merged 1 commit into
php:masterphp/php-src:masterfrom
zxcvdavid:rfc-preg-replace-callback-arrayzxcvdavid/php-src:rfc-preg-replace-callback-arrayCopy head branch name to clipboard
Mar 21, 2015
Merged

RFC: Implement preg_replace_callback_array function#1171
php-pulls merged 1 commit into
php:masterphp/php-src:masterfrom
zxcvdavid:rfc-preg-replace-callback-arrayzxcvdavid/php-src:rfc-preg-replace-callback-arrayCopy head branch name to clipboard

Conversation

@zxcvdavid
Copy link
Copy Markdown
Contributor

Patch for add preg_replace_callback_array function rfc:
https://wiki.php.net/rfc/preg_replace_callback_array

Any ideas?

@Majkl578
Copy link
Copy Markdown
Contributor

Huh? The name is horrible. Can't you just make preg_replace_callback accept an array of callbacks as its 2nd parameter? Would be consistent with preg_replace.

@nikic
Copy link
Copy Markdown
Member

nikic commented Mar 11, 2015

@Majkl578 That would be ambiguous, because an array can be a valid callback.

Comment thread ext/pcre/php_pcre.c Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why change this? nothing changed.

@zxcvdavid zxcvdavid force-pushed the rfc-preg-replace-callback-array branch from ac9fad4 to 7ee42f2 Compare March 12, 2015 01:30
@zxcvdavid
Copy link
Copy Markdown
Contributor Author

@laruence , thanks for you review. I updated it already.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a particular reason for using create_function() here instead of a regular anonymous function?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@datibbaw actually, no. ext/pcre/tests/preg_replace_callback_array.phpt and ext/pcre/tests/preg_replace_callback_array2.phpt are modified on the basis of preg_replace_callback.phpt and preg_replace_callback2.phpt

@zxcvdavid zxcvdavid force-pushed the rfc-preg-replace-callback-array branch 3 times, most recently from 5795a30 to 09bd278 Compare March 12, 2015 03:14
Comment thread ext/pcre/php_pcre.c Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not if (zcount && Z_TYPE_P(zcount))? it is more readable

@zxcvdavid zxcvdavid force-pushed the rfc-preg-replace-callback-array branch 4 times, most recently from 2854723 to ee11b0a Compare March 13, 2015 03:36
@zxcvdavid zxcvdavid force-pushed the rfc-preg-replace-callback-array branch from ee11b0a to 25566c6 Compare March 13, 2015 03:52
@laruence
Copy link
Copy Markdown
Member

@zxcvdavid I think you'd better drop a mail to @internal , if no objections, I will merge this... thanks

@zxcvdavid
Copy link
Copy Markdown
Contributor Author

@laruence i've sent the mail. Thanks for your reminding.

@php-pulls php-pulls merged commit 25566c6 into php:master Mar 21, 2015
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.

7 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.