PHP 8.4.1 Released!

xml_parser_get_option

(PHP 4, PHP 5, PHP 7, PHP 8)

xml_parser_get_optionGet options from an XML parser

Beschreibung

xml_parser_get_option(XMLParser $parser, int $option): string|int|bool

Gets an option value from an XML parser.

Parameter-Liste

parser
A reference to the XML parser to get an option from.
option
Which option to fetch. XML_OPTION_CASE_FOLDING, XML_OPTION_PARSE_HUGE, XML_OPTION_SKIP_TAGSTART, XML_OPTION_SKIP_WHITE and XML_OPTION_TARGET_ENCODING are available. See xml_parser_set_option() for their description.

Rückgabewerte

Returns the option's value.

Fehler/Exceptions

Throws a ValueError when an invalid value is passed to option.

Prior to PHP 8.0.0, passing an invalid value to option generated a E_WARNING as well as making the function return false.

Changelog

Version Beschreibung
8.3.0 The function now returns a boolean for boolean options.
8.0.0 parser erwartet nun eine XMLParser-Instanz; vorher wurde eine gültige xml-Ressource erwartet.
8.0.0 A ValueError is now thrown if option is invalid.
7.1.24, 7.2.12, 7.3.0 options now supports XML_OPTION_SKIP_TAGSTART and XML_OPTION_SKIP_WHITE.
add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top