zxcvdavid · GitHub

@zxcvdavid

Copy link Copy Markdown

Contributor

@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

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

laruence

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

Copy link Copy Markdown

Contributor Author

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

datibbaw

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

laruence

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

@zxcvdavid

@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

Read the original on github.com ↗