php-src/ext/standard/tests/network/bug20134.phpt

25 lines
533 B
Plaintext
Raw Normal View History

--TEST--
2003-01-23 19:07:25 +00:00
Bug #20134 (UDP reads from invalid ports)
--FILE--
<?php
# vim600:syn=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 */
2007-03-06 20:45:15 +00:00
$x = fwrite($fp,b"\n");
var_dump($x);
/* But reads should always fail */
$content = fread($fp, 40);
var_dump($content);
fclose($fp);
}
?>
--EXPECT--
int(1)
2009-04-24 19:47:43 +00:00
string(0) ""