Releases: rlanvin/php-ip
Releases · rlanvin/php-ip
v3.0.0
Backward Compatibility Breaking Changes
- Dropped support for PHP 7.0
- Deprecated auto-detection of binary strings for IPv6 #57
This means you can't directly pass the result ofinet_ptonto construct an IPv6 instance anymore, because it is
impossible to reliability distinguish some IPv6 human-readable representation from their binary string representation.
Instead, you need to use the explicit factory methodIPv6::createFromBinaryStringif you want to work withinet_pton.
Note: this is still supported for IPv4. IPBlock::getMask()renamed toIPBlock::getNetmask()IPBlock::getPrefix()renamed toIPBlock::getPrefixLength()IPBlock::getMaxPrefix()renamed toIPBlock::getMaxPrefixLength()IPBlock::getGivenIpWithPrefixLen()renamed toIPBlock::getGivenIpWithPrefixLength()- Separate "private" from other "reserved" IP addresses.
This changes the behaviour ofIP::isPrivate()andIPBlock::getPrivateBlocks()to be more narrow in scope.
The previous behaviour has been moved to new methods:IP::isReserved()andIPBlock::getReservedBlocks(). IP::isPrivate()renamed toIP::isReserved()IPBlock::getPrivateBlocks()renamed toIPBlock::getReservedBlocks()IP::isPrivate()now only tests if an IP is in a forwardable and non globally reachable IP Block as defined in the IANA special-purpose address registryIPBlock::getPrivateBlocks()now returns only the forwardable and non globally reachable IP Blocks as defined in the IANA special-purpose address registry
Added
- Support for PHP 8.1
- Support for PHP 8.0
- Added explicit factory methods for
IPv4/IPv6classes:
createFromInt,createFromFloat,createFromString,createFromBinaryString,createFromNumericStringandcreateFromGmp IPBlock::plus()andIpBlock::minus()now accept numeric strings and GMP instancesIPBlockIteratornow implementsArrayAccesswhich means you can write e.g.IPBlock::create('192.168.0.0/24')->getSubBlocks('/25')[1]- New methods for
IPv4Block/IPv6Block:getPrivateBlocks(),getLoopbackBlock(),getLinkLocalBlock()
Changed
- Optimise performance of
IP::isPrivate()
Fixed
IPBlock::containsnow always throws anInvalidArgumentExceptionif mixing IP versions
Removed
- Removed deprecated method
IPBlock::getSuper
v3.0.0-rc2
Backward Compatibility Breaking Changes
- Separate "private" from other "reserved" IP addresses.
This changes the behaviour ofIP::isPrivate()andIPBlock::getPrivateBlocks()to be more narrow in scope.
The previous behaviour has been moved to new methods:IP::isReserved()andIPBlock::getReservedBlocks(). IP::isPrivate()renamed toIP::isReserved()IPBlock::getPrivateBlocks()renamed toIPBlock::getReservedBlocks()IP::isPrivate()now only tests if an IP is in a forwardable and non globally reachable IP Block as defined in the IANA special-purpose address registryIPBlock::getPrivateBlocks()now returns only the forwardable and non globally reachable IP Blocks as defined in the IANA special-purpose address registry
v3.0.0-rc1
Backward Compatibility Breaking Changes
- Deprecated auto-detection of binary strings for IPv6 #57
This means you can't directly pass the result ofinet_ptonto construct an IPv6 instance anymore, because it is
impossible to reliability distinguish some IPv6 human-readable representation from their binary string representation.
Instead, you need to use the explicit factory methodIPv6::createFromBinaryStringif you want to work withinet_pton.
Note: this is still supported for IPv4. IPBlock::getMask()renamed toIPBlock::getNetmask()IPBlock::getPrefix()renamed toIPBlock::getPrefixLength()IPBlock::getMaxPrefix()renamed toIPBlock::getMaxPrefixLength()IPBlock::getGivenIpWithPrefixLen()renamed toIPBlock::getGivenIpWithPrefixLength()
Added
- Support for PHP 8.0
- Added explicit factory methods for
IPv4/IPv6classes:
createFromInt,createFromFloat,createFromString,createFromBinaryString,createFromNumericStringandcreateFromGmp IPBlock::plus()andIpBlock::minus()now accept numeric strings and GMP instancesIPBlockIteratornow implementsArrayAccesswhich means you can write e.g.IPBlock::create('192.168.0.0/24')->getSubBlocks('/25')[1]- New methods for
IPv4Block/IPv6Block:getPrivateBlocks(),getLoopbackBlock(),getLinkLocalBlock()
Changed
- Optimise performance of
IP::isPrivate()
Fixed
IPBlock::containsnow always throws anInvalidArgumentExceptionif mixing IP versions
Removed
- Removed deprecated method
IPBlock::getSuper