]> granicus.if.org Git - php/commitdiff
Make test more resilient
authorChristoph M. Becker <cmbecker69@gmx.de>
Mon, 11 Nov 2019 17:08:00 +0000 (18:08 +0100)
committerChristoph M. Becker <cmbecker69@gmx.de>
Mon, 11 Nov 2019 17:08:54 +0000 (18:08 +0100)
`socket_bind()` may raise `E_WARNING` on failure, which would cause the
test to fail.

ext/sockets/tests/socket_import_stream-3.phpt

index f83e8a487bcf533c46406e75cf990d13122643ad..61eccfc5377d9d820ef0c7d97749ddeb27820dac 100644 (file)
@@ -6,7 +6,7 @@ if (!extension_loaded('sockets')) {
        die('SKIP sockets extension not available.');
 }
 $s = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
-$br = socket_bind($s, '0.0.0.0', 58379);
+$br = @socket_bind($s, '0.0.0.0', 58379);
 if ($br === false)
        die("SKIP IPv4/port 58379 not available");
 $so = @socket_set_option($s, IPPROTO_IP, MCAST_JOIN_GROUP, array(