bug20134.phpt 565 B

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