Rct567 / DomQuery

PHP library for easy 'jQuery like' DOM traversing and manipulation.
MIT License
130 stars 38 forks source link

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

Closed kocoten1992 closed 7 months ago

kocoten1992 commented 7 months ago
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 commented 7 months ago

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 commented 7 months ago

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