diff --git a/NEWS b/NEWS index 836fdde2ccd..e029cdaaf72 100644 --- a/NEWS +++ b/NEWS @@ -17,6 +17,7 @@ PHP NEWS - XML: . Fixed bug #30875 (xml_parse_into_struct() does not resolve entities). (cmb) + . Add support for getting SKIP_TAGSTART and SKIP_WHITE options. (cmb) 11 Oct 2018, PHP 7.3.0RC3 diff --git a/ext/xml/tests/xml_parser_get_option_variation3.phpt b/ext/xml/tests/xml_parser_get_option_variation3.phpt new file mode 100644 index 00000000000..839daa96dd0 --- /dev/null +++ b/ext/xml/tests/xml_parser_get_option_variation3.phpt @@ -0,0 +1,29 @@ +--TEST-- +xml_parser_get_option() with XML_OPTION_SKIP_TAGSTART and XML_OPTION_SKIP_WHITE +--SKIPIF-- + +--FILE-- + +--EXPECT-- +defaults: +int(0) +int(0) +setting: +bool(true) +bool(true) +getting: +int(7) +int(1) diff --git a/ext/xml/xml.c b/ext/xml/xml.c index 3cacb31ad7b..8a5f7797ce1 100644 --- a/ext/xml/xml.c +++ b/ext/xml/xml.c @@ -1637,6 +1637,12 @@ PHP_FUNCTION(xml_parser_get_option) case PHP_XML_OPTION_CASE_FOLDING: RETURN_LONG(parser->case_folding); break; + case PHP_XML_OPTION_SKIP_TAGSTART: + RETURN_LONG(parser->toffset); + break; + case PHP_XML_OPTION_SKIP_WHITE: + RETURN_LONG(parser->skipwhite); + break; case PHP_XML_OPTION_TARGET_ENCODING: RETURN_STRING((char *)parser->target_encoding); break;