Skip to content

Remove unused variable 'error' #12438

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 15, 2023
Merged

Remove unused variable 'error' #12438

merged 1 commit into from
Oct 15, 2023

Conversation

nielsdos
Copy link
Member

Will also get rid of the potential allocation happening in zend_is_callable_ex().

Will also get rid of the potential allocation happening in
zend_is_callable_ex().
@nielsdos nielsdos marked this pull request as ready for review October 14, 2023 20:56
Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -654,14 +653,12 @@ PHP_FUNCTION(pcntl_signal)
RETURN_TRUE;
}

if (!zend_is_callable_ex(handle, NULL, 0, NULL, NULL, &error)) {
if (!zend_is_callable_ex(handle, NULL, 0, NULL, NULL, NULL)) {
PCNTL_G(last_error) = EINVAL;
Copy link
Member

Choose a reason for hiding this comment

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

Does it actually make sense to set the last error here?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think so, EINVAL is for invalid arguments, and the argument is definitely not valid if this check fails.

Copy link
Member

Choose a reason for hiding this comment

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

Well sure, but also this used to return false and a warning and not a TypeError, but eh I don't think it's super important.

@nielsdos nielsdos merged commit 5465cea into php:master Oct 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants