<?php
int gmp_scan1 ( GMP|int|string $num1, int $start )
where,
$num1 = The GMP number to scan
$start = The starting bit
?>
<?php
$bas01 = 10;
$s01 = gmp_init("101030200", $bas01);
for($b01 = 0; $b01 <= 11; $b01++)
{
$sc01 = gmp_scan1($s01, $b01);
echo "gmp_scan1($s01, $b01) = " . gmp_scan1($s01, $b01) . '<br>';
}
?>
<?php
echo "gmp_scan1(\"34234\", 1) = " .
gmp_scan1("434234", 1) ."<br><br>";
echo "gmp_scan1(4096, 0) = " .
gmp_scan1(4096, 0) ."<br><br>";
echo "gmp_scan1(\"1000000000\", 5) = " .
gmp_scan1("1000000000", 5) ."<br><br>";
echo "gmp_scan1('1000000000', 200) = " .
gmp_scan1("1000000000", 200) ."<br><br>";
try {
var_dump(gmp_scan1("434234", -10));
} catch (\ValueError $e) {
echo $e->getMessage() . "<br><br>";
}
$n = gmp_init("24234527465274");
var_dump(gmp_scan1($n, 10));
try {
var_dump(gmp_scan1(array(), 200));
} catch (\TypeError $e) {
echo $e->getMessage() . "<br><br>";
}
?>