Skip to content

v3.0.0-rc1

Pre-release
Pre-release

Choose a tag to compare

@rlanvin rlanvin released this 18 Apr 09:57
· 4 commits to master since this release

Backward Compatibility Breaking Changes

  • Deprecated auto-detection of binary strings for IPv6 #57
    This means you can't directly pass the result of inet_pton to 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 method IPv6::createFromBinaryString if you want to work with inet_pton.
    Note: this is still supported for IPv4.
  • IPBlock::getMask() renamed to IPBlock::getNetmask()
  • IPBlock::getPrefix() renamed to IPBlock::getPrefixLength()
  • IPBlock::getMaxPrefix() renamed to IPBlock::getMaxPrefixLength()
  • IPBlock::getGivenIpWithPrefixLen() renamed to IPBlock::getGivenIpWithPrefixLength()

Added

  • Support for PHP 8.0
  • Added explicit factory methods for IPv4/IPv6 classes:
    createFromInt, createFromFloat, createFromString, createFromBinaryString, createFromNumericString and createFromGmp
  • IPBlock::plus() and IpBlock::minus() now accept numeric strings and GMP instances
  • IPBlockIterator now implements ArrayAccess which 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::contains now always throws an InvalidArgumentException if mixing IP versions

Removed

  • Removed deprecated method IPBlock::getSuper