mirror of
https://github.com/php/php-src.git
synced 2024-11-23 18:04:36 +08:00
e9f783fcdd
For rationale, see #6787 Extensions migrated in part 3: * ftp * gmp * iconv * opcache * shmop
39 lines
718 B
PHP
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
|