Skip to content

Fix XML parser callbacks on PHP 8.4 - #14

Open
gorsky87 wants to merge 1 commit into
BenMorel:masterfrom
gorsky87:fix/php84-xml-parser
Open

Fix XML parser callbacks on PHP 8.4#14
gorsky87 wants to merge 1 commit into
BenMorel:masterfrom
gorsky87:fix/php84-xml-parser

Conversation

@gorsky87

Copy link
Copy Markdown

Summary

  • replace deprecated xml_set_object() usage with direct method callables
  • keep XML parsing behavior unchanged while avoiding PHP 8.4 deprecation warnings
  • add a regression test that fails if XML parsing emits E_DEPRECATED notices

Root cause

PHP 8.4 deprecates xml_set_object() and expects proper method callables to be passed to the xml_set_*_handler() functions. Passing string method names after removing xml_set_object() causes the parser resource itself to be passed incorrectly, which is the TypeError reported in the issue.

Validation

  • vendor/bin/phpunit test/Parser/XmlTest.php
  • php -d memory_limit=-1 vendor/bin/phpunit
  • PHP 8.4 container smoke test with XML parser deprecations converted to exceptions

Fixes #13.

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 this pull request may close these issues.

PHP 8.4: Deprecated Functionality: Function xml_set_object(

1 participant