Skip to content

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

Merged
Girgias merged 2 commits into
php:masterfrom
Girgias:sockets-wrong-count
Oct 13, 2025
Merged

ext/sockets: socket_recvfrom() improve error message when port argument is missing#20069
Girgias merged 2 commits into
php:masterfrom
Girgias:sockets-wrong-count

Conversation

@Girgias

Copy link
Copy Markdown
Member

Extract sockets changes from #20066

Comment threadext/sockets/tests/socket_recvfrom_ipv6_missing_port_arg.phpt
Comment threadext/sockets/sockets.c Outdated
@Girgias
Girgias marked this pull request as ready for review October 12, 2025 22:46
Comment threadext/sockets/sockets.c
if (arg6 == NULL) {
zend_string_efree(recv_buf);
WRONG_PARAM_COUNT;
zend_throw_exception(

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.

not a bad idea. zend_argument_count_error could have been used too but you avoid 1 allocation at least.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

I guess, but the thing I found confusing about that API is that it doesn't automatically prefix the function name.

@devnexendevnexen left a comment

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.

lgtm

@Girgias
Girgias merged commit fd1c366 into php:masterOct 13, 2025
10 checks passed
@Girgias
Girgias deleted the sockets-wrong-count branch October 13, 2025 12:44
Sign up for freeto 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.

3 participants

@Girgias@TimWolla@devnexen