1
0
mirror of https://github.com/php/php-src.git synced 2026-04-28 18:53:33 +02:00
Files
Ilija Tovilo 726cf51236 Add CONFLICT all to random port test
If we're very unlucky, we can get the same port opened as an ephemeral
port by some other test.

Closes GH-17706
2025-02-06 15:25:16 +01:00

29 lines
583 B
PHP

--TEST--
Bug #20134 (UDP reads from invalid ports)
--INI--
default_socket_timeout=1
--CONFLICTS--
all
--FILE--
<?php
$fp = fsockopen("udp://localhost", 65534, $errno, $errstr);
if (!$fp) {
/* UDP will never cause a connection error, as it is
* a connection-LESS protocol */
echo "ERROR: $errno - $errstr<br>\n";
}
else {
/* Likewise, writes will always appear to succeed */
$x = fwrite($fp,"\n");
var_dump($x);
/* But reads should always fail */
$content = fread($fp, 40);
var_dump($content);
fclose($fp);
}
?>
--EXPECT--
int(1)
bool(false)