php-src/ext/gmp/tests/gmp_scan1.phpt
Max Semenik e9f783fcdd Migrate skip checks to --EXTENSIONS--, p3
For rationale, see #6787

Extensions migrated in part 3:
* ftp
* gmp
* iconv
* opcache
* shmop
2021-04-03 15:23:25 +02:00

39 lines
718 B
PHP

--TEST--
gmp_scan1() basic tests
--EXTENSIONS--
gmp
--FILE--
<?php
try {
var_dump(gmp_scan1("434234", -10));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
}
var_dump(gmp_scan1("434234", 1));
var_dump(gmp_scan1(4096, 0));
var_dump(gmp_scan1("1000000000", 5));
var_dump(gmp_scan1("1000000000", 200));
$n = gmp_init("24234527465274");
var_dump(gmp_scan1($n, 10));
try {
var_dump(gmp_scan1(array(), 200));
} catch (\TypeError $e) {
echo $e->getMessage() . \PHP_EOL;
}
echo "Done\n";
?>
--EXPECT--
gmp_scan1(): Argument #2 ($start) must be greater than or equal to 0
int(1)
int(12)
int(9)
int(-1)
int(10)
gmp_scan1(): Argument #1 ($num1) must be of type GMP|string|int, array given
Done