Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ext/sockets: socket_recvfrom() improve error message when port argument is missing #20069

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

Draft
Girgias wants to merge 2 commits into php:master
base: master
Choose a base branch
Loading
from Girgias:sockets-wrong-count

Conversation

Copy link
Member

@Girgias Girgias commented Oct 5, 2025

Extract sockets changes from #20066

--TEST--
socket_recvfrom() with IPv6 socket missing port argument
--EXTENSIONS--
sockets
Copy link
Member

@devnexen devnexen Oct 5, 2025
edited
Loading

Choose a reason for hiding this comment

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

nit: I think you need ipv6_skipif.inc for this one.

Girgias reacted with thumbs up emoji
if (arg6 == NULL) {
zend_string_efree(recv_buf);
WRONG_PARAM_COUNT;
zend_argument_value_error(6, "must be specified when argument #1 ($socket) is of type AF_INET or AF_INET6");
Copy link
Member

@TimWolla TimWolla Oct 5, 2025

Choose a reason for hiding this comment

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

I believe this should stay ArgumentCountError, especially since it's an out parameter.

How about:

socket_recvfrom() expects exactly 6 arguments when argument #1 ($socket) is of type AF_INET or AF_INET6, $x given.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@TimWolla TimWolla TimWolla left review comments

@devnexen devnexen devnexen left review comments

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /