socket_select-wrongparams-3.phpt 609 B

12345678910111213141516171819202122232425262728
  1. --TEST--
  2. Test parameter handling in socket_select().
  3. --DESCRIPTION--
  4. Time must be long, otherwise it's casted.
  5. --SKIPIF--
  6. <?php
  7. if (!extension_loaded('sockets')) {
  8. die('SKIP The sockets extension is not loaded.');
  9. }
  10. --FILE--
  11. <?php
  12. $sockets = array();
  13. if (strtolower(substr(PHP_OS, 0, 3)) == 'win') {
  14. $domain = AF_INET;
  15. } else {
  16. $domain = AF_UNIX;
  17. }
  18. socket_create_pair($domain, SOCK_STREAM, 0, $sockets);
  19. $write = null;
  20. $except = null;
  21. $time = array();
  22. var_dump(socket_select($sockets, $write, $except, $time));
  23. --EXPECT--
  24. int(0)
  25. --CREDITS--
  26. Till Klampaeckel, till@php.net
  27. Berlin TestFest 2009