Skip to content

Fix the name of arguments for PHP 8 #287

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

Merged
merged 1 commit into from
Oct 23, 2020

Conversation

azjezz
Copy link
Contributor

@azjezz azjezz commented Oct 1, 2020

With PHP 8 coming, we need to have function/methods parameters names consistent between polyfills and the original implementations.

I'm not sure if this is all of it yet.

see:
php/php-tasks#23
php/php-tasks#16

function preg_replace_callback_array(array $patterns, $subject, $limit = -1, &$count = 0) { return p\Php70::preg_replace_callback_array($patterns, $subject, $limit, $count); }
/**
* $flags is not supported.
*/
function preg_replace_callback_array(array $pattern, $subject, $limit = -1, &$count = 0, $flags = null) { return p\Php70::preg_replace_callback_array($pattern, $subject, $limit, $count); }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

PHPs preg_replace_callback_array has a $flags argument, but the polyfill doesn't. so I added it. this would work the same.

Adding support for $flags is unrelated to this PR.

@azjezz azjezz force-pushed the fix/consistent-parameters branch 3 times, most recently from da8aa9f to e34e94a Compare October 1, 2020 21:20
@azjezz
Copy link
Contributor Author

azjezz commented Oct 1, 2020

we would probably have to do another round once PHP 8 is released, as more functions are being updated ATM.

@nicolas-grekas nicolas-grekas changed the base branch from master to main October 20, 2020 10:35
@nicolas-grekas nicolas-grekas changed the title consistent function parameters Fix the name of arguments for PHP 8 Oct 23, 2020
@nicolas-grekas nicolas-grekas force-pushed the fix/consistent-parameters branch from e34e94a to f75e14e Compare October 23, 2020 09:04
@nicolas-grekas
Copy link
Member

Thank you @azjezz.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants