gmp_scan1.phpt 885 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. --TEST--
  2. gmp_scan1() basic tests
  3. --SKIPIF--
  4. <?php if (!extension_loaded("gmp")) print "skip"; ?>
  5. --FILE--
  6. <?php
  7. var_dump(gmp_scan1("434234", -10));
  8. var_dump(gmp_scan1("434234", 1));
  9. var_dump(gmp_scan1(4096, 0));
  10. var_dump(gmp_scan1("1000000000", 5));
  11. var_dump(gmp_scan1("1000000000", 200));
  12. $n = gmp_init("24234527465274");
  13. var_dump(gmp_scan1($n, 10));
  14. var_dump(gmp_scan1(array(), 200));
  15. var_dump(gmp_scan1(array()));
  16. var_dump(gmp_scan1());
  17. echo "Done\n";
  18. ?>
  19. --EXPECTF--
  20. Warning: gmp_scan1(): Starting index must be greater than or equal to zero in %s on line %d
  21. bool(false)
  22. int(1)
  23. int(12)
  24. int(9)
  25. int(-1)
  26. int(10)
  27. Warning: gmp_scan1(): Unable to convert variable to GMP - wrong type in %s on line %d
  28. bool(false)
  29. Warning: gmp_scan1() expects exactly 2 parameters, 1 given in %s on line %d
  30. NULL
  31. Warning: gmp_scan1() expects exactly 2 parameters, 0 given in %s on line %d
  32. NULL
  33. Done