Skip to content

Commit 2869ccb

Browse files
committed
Review
1 parent 64c1f0e commit 2869ccb

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

ext/sockets/sockets.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,7 +1233,7 @@ PHP_FUNCTION(socket_connect)
12331233
struct sockaddr_in6 sin6 = {0};
12341234

12351235
if (ZEND_NUM_ARGS() != 3) {
1236-
zend_argument_count_error("Socket of type AF_INET6 requires port to be specified");
1236+
zend_argument_value_error(3, "must be specified for the AF_INET6 socket type");
12371237
RETURN_THROWS();
12381238
}
12391239

@@ -1254,7 +1254,7 @@ PHP_FUNCTION(socket_connect)
12541254
struct sockaddr_in sin = {0};
12551255

12561256
if (ZEND_NUM_ARGS() != 3) {
1257-
zend_argument_count_error("Socket of type AF_INET requires port to be specified");
1257+
zend_argument_value_error(3, "must be specified for the AF_INET socket type");
12581258
RETURN_THROWS();
12591259
}
12601260

@@ -2372,7 +2372,7 @@ PHP_FUNCTION(socket_addrinfo_bind)
23722372
}
23732373
default:
23742374
close(php_sock->bsd_socket);
2375-
efree(php_sock);
2375+
efree(php_sock);
23762376
zend_argument_value_error(1, "must be either AF_UNIX, AF_INET, or AF_INET6");
23772377
RETURN_THROWS();
23782378
}

ext/sockets/tests/socket_set_option_in6_pktinfo.phpt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,7 @@ if (!defined('IPV6_PKTINFO')) {
2121
<?php
2222

2323
$s = socket_create(AF_INET6, SOCK_DGRAM, SOL_UDP) or die("err");
24-
try {
25-
var_dump(socket_set_option($s, IPPROTO_IPV6, IPV6_PKTINFO, []));
26-
} catch (\ValueError $e) {
27-
echo $e->getMessage() . \PHP_EOL;
28-
}
24+
var_dump(socket_set_option($s, IPPROTO_IPV6, IPV6_PKTINFO, []));
2925
var_dump(socket_set_option($s, IPPROTO_IPV6, IPV6_PKTINFO, [
3026
"addr" => '::1',
3127
"ifindex" => 0

0 commit comments

Comments
 (0)