1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/ext/gmp/tests/bug81119.phpt
2021-06-10 17:48:16 +02:00

27 lines
718 B
PHP

--TEST--
GMP operators throw errors with wrong parameter names
--EXTENSIONS--
gmp
--FILE--
<?php
function test($f) {
try {
$f();
echo "No error?\n";
} catch (TypeError|ValueError $e) {
echo $e->getMessage(), "\n";
}
}
test(fn($WRONG_SCOPE_1 = 0, $WRONG_SCOPE_2 = 0) => gmp_init(1) < "x");
test(fn($WRONG_SCOPE_1 = 0, $WRONG_SCOPE_2 = 0) => gmp_init(1) < []);
test(fn($WRONG_SCOPE_1 = 0, $WRONG_SCOPE_2 = 0) => gmp_init(1) + "x");
test(fn($WRONG_SCOPE_1 = 0, $WRONG_SCOPE_2 = 0) => gmp_init(1) + []);
?>
--EXPECT--
Number is not an integer string
Number must be of type GMP|string|int, array given
Number is not an integer string
Number must be of type GMP|string|int, array given