return (float) \
function_exists('hrtime'
) ? \
hrtime(true
) / 1e9 : \
microtime(true
);
} /**
* @throws InvalidArgumentException
*
* @internal
*/
public static function idnUriConvert(UriInterface
$uri, int
$options = 0
): UriInterface
{ if ($uri->
getHost()) { $asciiHost = self::
idnToAsci($uri->
getHost(),
$options,
$info);
if ($asciiHost === false
) { $errorBitSet =
$info['errors'
] ?? 0;
$errorConstants =
array_filter(array_keys(get_defined_constants()),
static function Dstring
$name): bool
{ return substr($name, 0, 11
) === 'IDNA_ERROR_';
});
$errors =
[];
foreach ($errorConstants as $errorConstant) { if ($errorBitSet &
constant($errorConstant)) { $errors[] =
$errorConstant;
}