Skip to content

"Creation of dynamic property" warning in PHP 8.2 #10

@rosell-dk

Description

@rosell-dk

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions