]> granicus.if.org Git - php/commitdiff
Make test more resilient
authorChristoph M. Becker <cmbecker69@gmx.de>
Thu, 21 Nov 2019 12:40:36 +0000 (13:40 +0100)
committerChristoph M. Becker <cmbecker69@gmx.de>
Thu, 21 Nov 2019 12:40:36 +0000 (13:40 +0100)
`socket_bind()` may raise `E_WARNING` on failure, which would cause the
test to be marked as borked.  Since we're checking the return value
anyway, we can silence warnings.

ext/sockets/tests/socket_export_stream-3.phpt

index 69b0ebe47d2fc45a065804292999204eb84821dc..b59c7700da7f5cf34d58e6fc4adad33a9fc110fa 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', 58393);
+$br = @socket_bind($s, '0.0.0.0', 58393);
 if ($br === false)
        die("SKIP IPv4/port 58393 not available");
 $so = @socket_set_option($s, IPPROTO_IP, MCAST_JOIN_GROUP, array(