php-simple-html-dom-parser
php-simple-html-dom-parser copied to clipboard
"Creation of dynamic property" warning in PHP 8.2
I get:
Deprecated: Creation of dynamic property simple_html_dom\simple_html_dom::$optional_closing_array is deprecated in /home/rosell/github/dom-util-for-webp/vendor/kub-at/php-simple-html-dom-parser/src/KubAT/PhpSimple/lib/simple_html_dom.php on line 1489
From PHP 8.2, properties needs to be defined before used. In PHP 8.2, a warning is triggered. In PHP 9.0, an error will be thrown
See: https://wiki.php.net/rfc/deprecate_dynamic_properties
I'm aware that this should be fixed in the original simple_html_dom.php, but until then, I propose that it is fixed here.
To fix: Add this line in simple_html_dom.php, after line 1461:
protected $optional_closing_array;
I have created a ticket here as well: https://sourceforge.net/p/simplehtmldom/bugs/200/