gmp_mod.phpt 1006 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. --TEST--
  2. gmp_mod tests()
  3. --SKIPIF--
  4. <?php if (!extension_loaded("gmp")) print "skip"; ?>
  5. --FILE--
  6. <?php
  7. var_dump(gmp_mod());
  8. var_dump(gmp_mod(""));
  9. var_dump(gmp_mod("",""));
  10. var_dump(gmp_mod(0,1));
  11. var_dump(gmp_mod(0,-1));
  12. var_dump(gmp_mod(-1,0));
  13. var_dump(gmp_mod(array(), array()));
  14. $a = gmp_init("-100000000");
  15. $b = gmp_init("353467");
  16. var_dump(gmp_mod($a, $b));
  17. echo "Done\n";
  18. ?>
  19. --EXPECTF--
  20. Warning: gmp_mod() expects exactly 2 parameters, 0 given in %s on line %d
  21. NULL
  22. Warning: gmp_mod() expects exactly 2 parameters, 1 given in %s on line %d
  23. NULL
  24. Warning: gmp_mod(): Unable to convert variable to GMP - string is not an integer in %s on line %d
  25. bool(false)
  26. object(GMP)#%d (1) {
  27. ["num"]=>
  28. string(1) "0"
  29. }
  30. object(GMP)#%d (1) {
  31. ["num"]=>
  32. string(1) "0"
  33. }
  34. Warning: gmp_mod(): Zero operand not allowed in %s on line %d
  35. bool(false)
  36. Warning: gmp_mod(): Unable to convert variable to GMP - wrong type in %s on line %d
  37. bool(false)
  38. object(GMP)#%d (1) {
  39. ["num"]=>
  40. string(5) "31161"
  41. }
  42. Done