-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Remove some deprecated functions #4927
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
Conversation
Also, I think reflection can be changed for implode() after this/along with this. Look at the recent PRs to ext/standard/basic_functions.stub.php for this - e.g. https://github.com/php/php-src/pull/4772/files#r331638679
Second, there are some test failures to check out for implode() - I only checked travis
|
php_error_docref(NULL, E_DEPRECATED, | ||
"Passing glue string after array is deprecated. Swap the parameters"); | ||
} else if (Z_TYPE_P(arg2) == IS_ARRAY) { | ||
if (Z_TYPE_P(arg1) == IS_STRING) { | ||
glue = zval_get_tmp_string(arg1, &tmp_glue); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also get rid of tmp_glue and zend_tmp_string_release, because Z_PARAM_STR gives you the zend_string
Thanks for working on this @kocsismate! |
Converts logical Hebrew text to visual text with newline conversion */ | ||
PHP_FUNCTION(hebrevc) | ||
{ | ||
php_hebrev(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to me that we now can inline php_hebrev()
into PHP_FUNCTION(hebrev)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea! Just committed it.
@@ -178,9 +178,6 @@ static const func_info_t func_infos[] = { | |||
F1("str_split", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING), | |||
F1("strpbrk", MAY_BE_FALSE | MAY_BE_STRING), | |||
F0("substr_compare", MAY_BE_FALSE | MAY_BE_LONG), | |||
#ifdef HAVE_STRFMON |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should also drop the strfmon check in configure.
5cc8567
to
b8308c1
Compare
php_error_docref(NULL, E_DEPRECATED, | ||
"Passing glue string after array is deprecated. Swap the parameters"); | ||
} else if (Z_TYPE_P(arg2) == IS_ARRAY) { | ||
if (Z_TYPE_P(arg1) == IS_STRING) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, this changes the behavior: Previously it would cast anything (that isn't an array) to a string, now it strictly requires a string. Ideally it would follow zpp rules...
Apart from implode, this looks fine. Please commit the rest with appropriate notes in UPGRADING. |
I've opened #4970 as preparation for handling implode properly. |
Thanks Nikita! I saw the PR is merged now, so I'll make use of it. |
I noticed while I was working on the stub for the
implode()
function that some of the deprecations of https://wiki.php.net/rfc/deprecations_php_7_4 haven't been implemented yet for PHP 8.I hope it's not a problem that I wanted to help with the implementation.