gh9308.phpt 404 B

12345678910111213141516171819
  1. --TEST--
  2. Bug GH-9308: GMP throws the wrong error when a GMP object is passed to gmp_init()
  3. --EXTENSIONS--
  4. gmp
  5. --FILE--
  6. <?php
  7. declare(strict_types=1);
  8. /* We need strict_types as GMP has a __toString() handler */
  9. try {
  10. $gmp = gmp_init(gmp_init(123));
  11. } catch (\TypeError $e) {
  12. echo $e->getMessage(), \PHP_EOL;
  13. }
  14. ?>
  15. --EXPECT--
  16. gmp_init(): Argument #1 ($num) must be of type string|int, GMP given