src/PackageSelection/PackageSelection.php
private function matchAddr($addr1, $addr2, $len = 0, $chunklen = 32)
    {
        for (; $len > 0; $len -= $chunklen, next($addr1), next($addr2)) {
            $shift = $len >= $chunklen ? 0 : $chunklen - $len;
            if ((current($addr1) >> $shift) !== (current($addr2) >> $shift)) {
                return false;
            }
        }

        return true;
    }
private function matchAddr($addr1, $addr2, $len = 0, $chunklen = 32)
    {
        for (; $len > 0; $len -= $chunklen, next($addr1), next($addr2)) {
            $shift = $len >= $chunklen ? 0 : $chunklen - $len;
            if ((current($addr1) >> $shift) !== (current($addr2) >> $shift)) {
                return false;
            }
        }

        return true;
    }
private function matchAddr ( $ addr1 , $ addr2 , $ len = 0 , $ chunklen = 32 ) { for ( ; $ len > 0 ; $ len -= $ chunklen , next ( $ addr1 ) , next ( $ addr2 ) ) { $ shift = $ len >= $ chunklen ? 0 : $ chunklen - $ len ; if ( ( current ( $ addr1 ) >> $ shift ) !== ( current ( $ addr2 ) >> $ shift ) ) { return false ; } } return true ; }
Test if two addresses have the same prefix

@param int[] $addr1
Chunked addr
@param int[] $addr2
Chunked addr
@param int $len
Length of the test
@param int $chunklen
Length of each chunk

@return bool
Test if two addresses have the same prefix