RFC: Implement preg_replace_callback_array function#1171
RFC: Implement preg_replace_callback_array function#1171php-pulls merged 1 commit intophp:masterfrom
Conversation
|
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. |
|
@Majkl578 That would be ambiguous, because an array can be a valid callback. |
ext/pcre/php_pcre.c
Outdated
There was a problem hiding this comment.
why change this? nothing changed.
ac9fad4 to
7ee42f2
Compare
|
@laruence , thanks for you review. I updated it already. |
There was a problem hiding this comment.
Is there a particular reason for using create_function() here instead of a regular anonymous function?
There was a problem hiding this comment.
@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
5795a30 to
09bd278
Compare
ext/pcre/php_pcre.c
Outdated
There was a problem hiding this comment.
why not if (zcount && Z_TYPE_P(zcount))? it is more readable
2854723 to
ee11b0a
Compare
ee11b0a to
25566c6
Compare
|
@zxcvdavid I think you'd better drop a mail to @internal , if no objections, I will merge this... thanks |
|
@laruence i've sent the mail. Thanks for your reminding. |
Patch for add preg_replace_callback_array function rfc:
https://wiki.php.net/rfc/preg_replace_callback_array
Any ideas?