~ubuntu-branches/ubuntu/hardy/php5/hardy-updates

« back to all changes in this revision

Viewing changes to ext/standard/tests/network/bug20134.phpt

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-10-09 03:14:32 UTC
  • Revision ID: james.westby@ubuntu.com-20051009031432-kspik3lobxstafv9
Tags: upstream-5.0.5
ImportĀ upstreamĀ versionĀ 5.0.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--TEST--
 
2
Bug #20134 (UDP reads from invalid ports)
 
3
--FILE--
 
4
<?php
 
5
# vim600:syn=php:
 
6
$fp = fsockopen("udp://localhost", 65534, $errno, $errstr);
 
7
if (!$fp) {
 
8
        /* UDP will never cause a connection error, as it is
 
9
         * a connection-LESS protocol */
 
10
    echo "ERROR: $errno - $errstr<br>\n";
 
11
}
 
12
else {
 
13
        /* Likewise, writes will always appear to succeed */
 
14
    $x = fwrite($fp,"\n");
 
15
        var_dump($x);
 
16
        /* But reads should always fail */
 
17
    $content = fread($fp, 40);
 
18
        var_dump($content);
 
19
    fclose($fp);
 
20
}
 
21
?>
 
22
--EXPECT--
 
23
int(1)
 
24
string(0) ""