php-html-parser
php-html-parser copied to clipboard
PHP 8.1 error
If you are using php 8.1 you will get a depreciated error in Collections.php function offsetGet() because it does not have a 'mixed' return type. This can be fixed by either adding #[\ReturnTypeWillChange] before the function or adding 'mixed' as the return type.
https://github.com/paquettg/php-html-parser/pull/291
After waiting for a while, did the update and pushed to packages https://packagist.org/packages/minasm/php-html-parser :)
@minasm, First of all, thank you for providing an updated version of the package. I'm getting a different warning:
Deprecated: Return type of PHPHtmlParser\Dom\Node\Collection::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /vendor/minasm/php-html-parser/src/PHPHtmlParser/Dom/Node/Collection.php on line 133
Would it be possible to make this correction in your version, since @paquettg's doesn't seem to be being updated?
FYI: I'm using PHP 8.2