mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
ext/xml: Add an explicit test case about unsetting a handler with empty string
This commit is contained in:
25
ext/xml/tests/set_handler_deprecation_empty_string.phpt
Normal file
25
ext/xml/tests/set_handler_deprecation_empty_string.phpt
Normal file
@@ -0,0 +1,25 @@
|
||||
--TEST--
|
||||
Unsetting a handler via an empty string should emit a deprecation
|
||||
--EXTENSIONS--
|
||||
xml
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/* Use xml_set_processing_instruction_handler() for generic implementation */
|
||||
function dummy() {}
|
||||
|
||||
/* Create valid parser */
|
||||
$parser = xml_parser_create();
|
||||
xml_set_processing_instruction_handler($parser, dummy(...));
|
||||
|
||||
try {
|
||||
xml_set_processing_instruction_handler($parser, '');
|
||||
} catch (\Throwable $e) {
|
||||
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
|
||||
?>
|
||||
END
|
||||
--EXPECTF--
|
||||
Deprecated: xml_set_processing_instruction_handler(): Passing non-callable strings is deprecated since 8.4 in %s on line %d
|
||||
END
|
||||
Reference in New Issue
Block a user