srand_basic.phpt 606 B

123456789101112131415161718192021222324252627
  1. --TEST--
  2. Test srand() - basic function test for srand()
  3. --FILE--
  4. <?php
  5. echo "*** Testing srand() : basic functionality ***\n";
  6. // Should return NULL if given anything that it can convert to long
  7. // This doesn't actually test what it does with the input :-\
  8. var_dump(srand());
  9. var_dump(srand(500));
  10. var_dump(srand(500.1));
  11. var_dump(srand("500"));
  12. var_dump(srand("500E3"));
  13. var_dump(srand(true));
  14. var_dump(srand(false));
  15. ?>
  16. --EXPECTF--
  17. *** Testing srand() : basic functionality ***
  18. NULL
  19. NULL
  20. Deprecated: Implicit conversion from float 500.1 to int loses precision in %s on line %d
  21. NULL
  22. NULL
  23. NULL
  24. NULL
  25. NULL