]> granicus.if.org Git - php/commitdiff
Don't throw warning if testing multiple ports
authorNikita Popov <nikita.ppv@gmail.com>
Wed, 12 Jun 2019 14:57:28 +0000 (16:57 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Thu, 13 Jun 2019 07:34:23 +0000 (09:34 +0200)
ext/sockets/tests/ipv6loop.phpt
ext/sockets/tests/socket_getpeername_ipv4loop.phpt

index 307f61f082348540cc76666090d93f0a4f06e73a..24e2b6d4f66b73e73f18e5fa6a5e79f9c8daa628 100644 (file)
@@ -16,7 +16,7 @@ IPv6 Loopback test
        }
        $bound = false;
        for($port = 31337; $port < 31357; ++$port) {
-               if (socket_bind($server, '::1', $port)) {
+               if (@socket_bind($server, '::1', $port)) {
                        $bound = true;
                        break;
                }
index efd2a6b4456461951d08db9223738647aeac011b..c7eb1003e040052a7f72840501e8adc1f89fd10f 100644 (file)
@@ -24,7 +24,7 @@ Tatjana Andersen tatjana.andersen@redpill-linpro.com
        $maxport = 31356;
        $bound = false;
        for($port = $minport; $port <= $maxport; ++$port) {
-               if (socket_bind($server, $localhost, $port)) {
+               if (@socket_bind($server, $localhost, $port)) {
                        $bound = true;
                        break;
                }