1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
--TEST--
Surprising result with integer literals (hex/binary/octal)
--EXTENSIONS--
gmp
--FILE--
<?php
$values = [
'0x',
'0X',
'0b',
'0B',
'0o',
'0O',
''
];
foreach ($values as $value) {
try {
var_dump(gmp_init($value));
} catch (\ValueError $e) {
echo $e->getMessage(), \PHP_EOL;
}
}
?>
--EXPECT--
gmp_init(): Argument #1 ($num) is not an integer string
gmp_init(): Argument #1 ($num) is not an integer string
gmp_init(): Argument #1 ($num) is not an integer string
gmp_init(): Argument #1 ($num) is not an integer string
gmp_init(): Argument #1 ($num) is not an integer string
gmp_init(): Argument #1 ($num) is not an integer string
gmp_init(): Argument #1 ($num) is not an integer string
|