Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8.1 error #296

Open
bartonlp opened this issue Feb 1, 2022 · 3 comments
Open

PHP 8.1 error #296

bartonlp opened this issue Feb 1, 2022 · 3 comments

Comments

@bartonlp
Copy link

bartonlp commented Feb 1, 2022

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.

@AkioSarkiz
Copy link

#291

@minasm
Copy link

minasm commented Oct 17, 2022

After waiting for a while, did the update and pushed to packages https://packagist.org/packages/minasm/php-html-parser :)

@paulodetarsofm
Copy link

paulodetarsofm commented Oct 19, 2023

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants