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

Error with method signature of Collection::offsetGet() #290

Open
davidbyoung opened this issue Oct 10, 2021 · 1 comment · May be fixed by #291
Open

Error with method signature of Collection::offsetGet() #290

davidbyoung opened this issue Oct 10, 2021 · 1 comment · May be fixed by #291

Comments

@davidbyoung
Copy link

PHP 8.1 RC3 errors due to the fact that Collection::offsetGet() does not declare the return type.

PHP Fatal error:  During inheritance of ArrayAccess: Uncaught ErrorException: 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/paquettg/php-html-parser/src/PHPHtmlParser/Dom/Node/Collection.php:133

Rather than upgrade to PHP 8, this library could use the #[\ReturnTypeWillChange] as suggested in the error, which will just be interpreted as a harmless PHP comment in PHP < 8.

@DgithubA
Copy link

DgithubA commented May 18, 2023

i use php ver 8.2.0 and still got this error.

error Trace:
error Trace

code:
code

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

Successfully merging a pull request may close this issue.

2 participants