gmp_random.phpt 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. --TEST--
  2. gmp_random() basic tests
  3. --SKIPIF--
  4. <?php if (!extension_loaded("gmp")) print "skip"; ?>
  5. --FILE--
  6. <?php
  7. var_dump(gmp_strval(gmp_random()));
  8. var_dump(gmp_strval(gmp_random(-1)));
  9. var_dump(gmp_strval(gmp_random(0)));
  10. var_dump(gmp_strval(gmp_random(10)));
  11. var_dump(gmp_strval(gmp_random("-10")));
  12. var_dump(gmp_strval(gmp_random(-10)));
  13. var_dump(gmp_random(array()));
  14. var_dump(gmp_random(array(),1));
  15. var_dump(gmp_random(""));
  16. var_dump(gmp_random("test"));
  17. echo "Done\n";
  18. ?>
  19. --EXPECTF--
  20. Deprecated: Function gmp_random() is deprecated in %s on line %d
  21. string(%d) "%d"
  22. Deprecated: Function gmp_random() is deprecated in %s on line %d
  23. string(%d) "%d"
  24. Deprecated: Function gmp_random() is deprecated in %s on line %d
  25. string(1) "%d"
  26. Deprecated: Function gmp_random() is deprecated in %s on line %d
  27. string(%d) "%d"
  28. Deprecated: Function gmp_random() is deprecated in %s on line %d
  29. string(%d) "%d"
  30. Deprecated: Function gmp_random() is deprecated in %s on line %d
  31. string(%d) "%d"
  32. Deprecated: Function gmp_random() is deprecated in %s on line %d
  33. Warning: gmp_random() expects parameter 1 to be int, array given in %s on line %d
  34. NULL
  35. Deprecated: Function gmp_random() is deprecated in %s on line %d
  36. Warning: gmp_random() expects at most 1 parameter, 2 given in %s on line %d
  37. NULL
  38. Deprecated: Function gmp_random() is deprecated in %s on line %d
  39. Warning: gmp_random() expects parameter 1 to be int, string given in %s on line %d
  40. NULL
  41. Deprecated: Function gmp_random() is deprecated in %s on line %d
  42. Warning: gmp_random() expects parameter 1 to be int, string given in %s on line %d
  43. NULL
  44. Done