Return to bug20134.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / network |
1.1 misho 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,b"\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) ""