php-src/ext/gmp/tests/surprising_integer_literals.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

33 lines
748 B
PHP

--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