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

Creation of dynamic property Rct567\DomQuery\DomQuery::$dom_xpath is deprecated #43

Closed
kocoten1992 opened this issue Nov 13, 2023 · 2 comments

Comments

@kocoten1992
Copy link

Creation of dynamic property Rct567\DomQuery\DomQuery::$dom_xpath is deprecated in vendor/rct567/dom-query/src/Rct567/DomQuery/DomQueryNodes.php on line 171.

Hello, thanks for the library, I got the error when run php 8.2, dynamic property is deprecated (https://php.watch/versions/8.2/dynamic-properties-deprecated).

To trigger the error:

$dom = new DomQuery('<div><h1 class="title">Hello</h1></div>');
$dom->find('randomtag')->html()
@Rct567
Copy link
Owner

Rct567 commented Nov 13, 2023

dom_xpath is already a method is the dev branch. Do you get any errors when using that branch? Either way, a #[AllowDynamicProperties] is preferred :)

@kocoten1992
Copy link
Author

Hi there, I've not test yet, currently I'm using @ to supress it 😆, I will close this issue with the PR then, thanks for the library!

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