This fixes a bug with IPV6 addresses, since previously a GMP object was passed to static::isIPV6() and thus the function always returned false. Furthermore, the standard PHPpow() function isn't really optimal for IPV6 either and is now replaced by gmp_pow() instead. Casting GMP objects to integer also causes many unwanted troubles when converting large numbers back with gmp_intval(), so static::isAddrInside() uses only gmp auxiliary functions.
All these problems are caught by the new unit tests added in 6536e25.
This fixes a bug with IPV6 addresses, since previously a
GMP
object was passed tostatic::isIPV6()
and thus the function always returnedfalse
. Furthermore, the standardPHP
pow()
function isn't really optimal forIPV6
either and is now replaced bygmp_pow()
instead. CastingGMP
objects to integer also causes many unwanted troubles when converting large numbers back withgmp_intval()
, sostatic::isAddrInside()
uses only gmp auxiliary functions.All these problems are caught by the new unit tests added in 6536e25.