<?php
echo 'Hexadecimal', \PHP_EOL;
try {
var_dump(gmp_init('0X'));
} catch (\TypeError $e) {
echo $e->getMessage(), \PHP_EOL;
}
try {
var_dump(gmp_init('0x'));
} catch (\TypeError $e) {
echo $e->getMessage(), \PHP_EOL;
}
try {
var_dump(gmp_init('0X', 16));
} catch (\TypeError $e) {
echo $e->getMessage(), \PHP_EOL;
}
try {
var_dump(gmp_init('0x', 16));
} catch (\TypeError $e) {
echo $e->getMessage(), \PHP_EOL;
}
echo 'Binary', \PHP_EOL;
try {
var_dump(gmp_init('0B'));
} catch (\TypeError $e) {
echo $e->getMessage(), \PHP_EOL;
}
try {
var_dump(gmp_init('0b'));
} catch (\TypeError $e) {
echo $e->getMessage(), \PHP_EOL;
}
try {
var_dump(gmp_init('0B', 2));
} catch (\TypeError $e) {
echo $e->getMessage(), \PHP_EOL;
}
try {
var_dump(gmp_init('0b', 2));
} catch (\TypeError $e) {
echo $e->getMessage(), \PHP_EOL;
}
echo "Done\n";
preferences:
55.64 ms | 402 KiB | 5 Q