Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Find whether the type of a variable is integer
<?php is_int(mixed $value): bool
<?php         if (\preg_match('#^php://fd/(\d+)$#', $fd, $m)) {

            $fd = (int) $m[1];

        }

        if (!\is_int($fd) || $fd < 0 || $fd >= \PHP_INT_MAX) {

            throw new \InvalidArgumentException(

                'Invalid FD number given (EINVAL)',

                \defined('SOCKET_EINVAL') ? \SOCKET_EINVAL : 22