[php-src] Issue #7775: Multiple undocumented BC in DOM extension

From: Date: Tue, 14 Dec 2021 23:37:49 +0000
Subject: [php-src] Issue #7775: Multiple undocumented BC in DOM extension
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-238415@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/7775
Author: WinterSilence

### Description

For example, many DOMNamedNodeMap methods was removed in PHP 8 without any information
in "Breaking changes".
~~~php
$rc = new ReflectionClass(DOMNamedNodeMap::class);
echo (string) $rc;
~~~
[PHP 7.3](https://3v4l.org/fWo1m#v7.3.33)
```
Class [ <internal:dom> <iterateable> class DOMNamedNodeMap implements Traversable,
Countable ] {
  - Methods [8] {
    Method [ <internal:dom> public method getNamedItem ] {
      - Parameters [1] {
        Parameter #0 [ <required> $name ]
      }
    }

    Method [ <internal:dom> public method setNamedItem ] {
      - Parameters [1] {
        Parameter #0 [ <required> DOMNode $arg ]
      }
    }

    Method [ <internal:dom> public method removeNamedItem ] {
      - Parameters [1] {
        Parameter #0 [ <optional> $name ]
      }
    }

    Method [ <internal:dom> public method item ] {
      - Parameters [1] {
        Parameter #0 [ <optional> $index ]
      }
    }

    Method [ <internal:dom> public method getNamedItemNS ] {
      - Parameters [2] {
        Parameter #0 [ <optional> $namespaceURI ]
        Parameter #1 [ <optional> $localName ]
      }
    }

    Method [ <internal:dom> public method setNamedItemNS ] {
      - Parameters [1] {
        Parameter #0 [ <optional> DOMNode $arg ]
      }
    }

    Method [ <internal:dom> public method removeNamedItemNS ] {
      - Parameters [2] {
        Parameter #0 [ <optional> $namespaceURI ]
        Parameter #1 [ <optional> $localName ]
      }
    }

    Method [ <internal:dom, prototype Countable> public method count ] {
      - Parameters [0] {
      }
    }
  }
}
```
[PHP 8.1](https://3v4l.org/fWo1m#v8.1.0)
```
Class [ <internal:dom> <iterateable> class DOMNamedNodeMap implements IteratorAggregate,
Traversable, Countable ] {
  - Properties [1] {
    Property [ public int $length ]
  }

  - Methods [5] {
    Method [ <internal:dom> public method getNamedItem ] {
      - Parameters [1] {
        Parameter #0 [ <required> string $qualifiedName ]
      }
      - Tentative return [ ?DOMNode ]
    }

    Method [ <internal:dom> public method getNamedItemNS ] {
      - Parameters [2] {
        Parameter #0 [ <required> ?string $namespace ]
        Parameter #1 [ <required> string $localName ]
      }
      - Tentative return [ ?DOMNode ]
    }

    Method [ <internal:dom> public method item ] {
      - Parameters [1] {
        Parameter #0 [ <required> int $index ]
      }
      - Tentative return [ ?DOMNode ]
    }

    Method [ <internal:dom, prototype Countable> public method count ] {
      - Parameters [0] {
      }
      - Tentative return [ int ]
    }

    Method [ <internal:dom, prototype IteratorAggregate> public method getIterator ] {
      - Parameters [0] {
      }
      - Return [ Iterator ]
    }
  }
}
```
Other DOM classes haves same BC.

### PHP Version

7.1 - 8.1

### Operating System

no matter


Thread (1 message)

  • WinterSilence
« previous php.bugs (#238415) next »