1
0
mirror of https://github.com/php/php-src.git synced 2026-04-26 09:28:21 +02:00
Files
archived-php-src/ext/standard/tests/network/bug20134.phpt
T
Nikita Popov 11bf5ccf62 Set default_socket_timeout in test
If the read is not refused outright, this will timeout, and we
don't want to wait 60s for that.
2021-05-19 15:29:38 +02:00

27 lines
565 B
PHP

--TEST--
Bug #20134 (UDP reads from invalid ports)
--INI--
default_socket_timeout=1
--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)