stream_002.phpt 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. --TEST--
  2. stream_socket_client() and invalid arguments
  3. --FILE--
  4. <?php
  5. $a = NULL;
  6. $b = NULL;
  7. var_dump(stream_socket_client("", $a, $b));
  8. var_dump($a, $b);
  9. var_dump(stream_socket_client("[", $a, $b));
  10. var_dump($a, $b);
  11. var_dump(stream_socket_client("[ ", $a, $b));
  12. var_dump($a, $b);
  13. var_dump(stream_socket_client(".", $a, $b));
  14. var_dump($a, $b);
  15. var_dump(stream_socket_client(1, $a, $b));
  16. var_dump($a, $b);
  17. echo "Done\n";
  18. ?>
  19. --EXPECTF--
  20. Warning: stream_socket_client(): Unable to connect to (Failed to parse address "") in %s on line %d
  21. bool(false)
  22. int(0)
  23. string(26) "Failed to parse address """
  24. Warning: stream_socket_client(): Unable to connect to [ (Failed to parse address "[") in %s on line %d
  25. bool(false)
  26. int(0)
  27. string(27) "Failed to parse address "[""
  28. Warning: stream_socket_client(): Unable to connect to [ (Failed to parse%saddress "[ ") in %s on line %d
  29. bool(false)
  30. int(0)
  31. string(%d) "Failed to parse%saddress "[ ""
  32. Warning: stream_socket_client(): Unable to connect to . (Failed to parse address ".") in %s on line %d
  33. bool(false)
  34. int(0)
  35. string(27) "Failed to parse address ".""
  36. Warning: stream_socket_client(): Unable to connect to 1 (Failed to parse address "1") in %s on line %d
  37. bool(false)
  38. int(0)
  39. string(27) "Failed to parse address "1""
  40. Done