src/IPAddress.php
private static function myValidateOctet(int $octet, ?string &$error): bool
    {
        if ($octet < 0) {
            $error = 'Octet ' . $octet . ' is out of range: Minimum value for an octet is 0.';

            return false;
        }

        if ($octet > 255) {
            $error = 'Octet ' . $octet . ' is out of range: Maximum value for an octet is 255.';

            return false;
        }

        return true;
    }
private static function myValidateOctet(int $octet, ?string &$error): bool
    {
        if ($octet < 0) {
            $error = 'Octet ' . $octet . ' is out of range: Minimum value for an octet is 0.';

            return false;
        }

        if ($octet > 255) {
            $error = 'Octet ' . $octet . ' is out of range: Maximum value for an octet is 255.';

            return false;
        }

        return true;
    }
private static function myValidateOctet ( int $ octet , ? string & $ error ) : bool { if ( $ octet < 0 ) { $ error = 'Octet ' . $ octet . ' is out of range: Minimum value for an octet is 0.' ; return false ; } if ( $ octet > 255 ) { $ error = 'Octet ' . $ octet . ' is out of range: Maximum value for an octet is 255.' ; return false ; } return true ; }
Validates an octet.

@param int         $octet The octet.
@param string|null $error The error text if validation was not successful, undefined otherwise.

@return bool True if validation was successful, false otherwise.
Validates an octet .