PHP 8.4 | :sparkles: New PHPCompatibility.ParameterValues.RemovedXmlSetHandlerCallbackUnset sniff (RFC) by jrfnl · Pull Request #1744 · PHPCompatibility/PHPCompatibility

Skip to content

Navigation Menu

Sign in

Appearance settings

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Conversation

@jrfnl

Copy link Copy Markdown

Member

@jrfnl jrfnl commented

Aug 15, 2024

. Passing non-callable strings to the xml_set_*_handler() functions is now
deprecated.
RFC: https://wiki.php.net/rfc/deprecations_php_8_4#xml_set_object_and_xml_set_handler_with_string_method_names

While PHPCS is not particularly suitable to validate whether a string is callable or not, the "This would also mean to unset a handler the value of null must be used instead of an empty string which is also currently allowed." part of the RFC should be sniffable.

This commit introduces a new sniff to detect and flag this.

Includes tests.
Includes documentation.

Refs:

Related to #1731

…CallbackUnset sniff (RFC)

> . Passing non-callable strings to the xml_set_*_handler() functions is now
>   deprecated.
>   RFC: https://wiki.php.net/rfc/deprecations_php_8_4#xml_set_object_and_xml_set_handler_with_string_method_names

While PHPCS is not particularly suitable to validate whether a string is callable or not, the _"This would also mean to unset a handler the value of null must be used instead of an empty string which is also currently allowed."_ part of the RFC should be sniffable.

This commit introduces a new sniff to detect and flag this.

Includes tests.
Includes documentation.

Refs:
* https://wiki.php.net/rfc/deprecations_php_8_4#xml_set_object_and_xml_set_handler_with_string_method_names
* https://github.com/php/php-src/blob/c42615782334323511cda18a8f0dd3dc19ed6256/UPGRADING#L496-L497
* php/php-src 15293
* php/php-src@25b4696

Related to 1731

@wimg wimg merged commit 0c8cfbd into develop

Sep 7, 2024

@wimg wimg deleted the php-8.4/new-removedxmlsethandledcallbackunset-sniff branch

September 7, 2024 19:02

@jrfnl jrfnl added the PHP: 8.4 label

Nov 4, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@wimg wimg wimg approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

10.0.0-alpha1

Development

Successfully merging this pull request may close these issues.

2 participants

@jrfnl @wimg