bug81119.phpt 718 B

1234567891011121314151617181920212223242526
  1. --TEST--
  2. GMP operators throw errors with wrong parameter names
  3. --EXTENSIONS--
  4. gmp
  5. --FILE--
  6. <?php
  7. function test($f) {
  8. try {
  9. $f();
  10. echo "No error?\n";
  11. } catch (TypeError|ValueError $e) {
  12. echo $e->getMessage(), "\n";
  13. }
  14. }
  15. test(fn($WRONG_SCOPE_1 = 0, $WRONG_SCOPE_2 = 0) => gmp_init(1) < "x");
  16. test(fn($WRONG_SCOPE_1 = 0, $WRONG_SCOPE_2 = 0) => gmp_init(1) < []);
  17. test(fn($WRONG_SCOPE_1 = 0, $WRONG_SCOPE_2 = 0) => gmp_init(1) + "x");
  18. test(fn($WRONG_SCOPE_1 = 0, $WRONG_SCOPE_2 = 0) => gmp_init(1) + []);
  19. ?>
  20. --EXPECT--
  21. Number is not an integer string
  22. Number must be of type GMP|string|int, array given
  23. Number is not an integer string
  24. Number must be of type GMP|string|int, array given