mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Merge branch 'PHP-7.3'
* PHP-7.3: Add support for getting SKIP_TAGSTART and SKIP_WHITE options
This commit is contained in:
commit
fc0aa264c1
2 changed files with 35 additions and 0 deletions
29
ext/xml/tests/xml_parser_get_option_variation3.phpt
Normal file
29
ext/xml/tests/xml_parser_get_option_variation3.phpt
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
--TEST--
|
||||||
|
xml_parser_get_option() with XML_OPTION_SKIP_TAGSTART and XML_OPTION_SKIP_WHITE
|
||||||
|
--SKIPIF--
|
||||||
|
<?php
|
||||||
|
if (!extension_loaded('xml')) die('skip xml extension not available');
|
||||||
|
?>
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
$parser = xml_parser_create();
|
||||||
|
echo "defaults:\n";
|
||||||
|
var_dump(xml_parser_get_option($parser, XML_OPTION_SKIP_TAGSTART));
|
||||||
|
var_dump(xml_parser_get_option($parser, XML_OPTION_SKIP_WHITE));
|
||||||
|
echo "setting:\n";
|
||||||
|
var_dump(xml_parser_set_option($parser, XML_OPTION_SKIP_TAGSTART, 7));
|
||||||
|
var_dump(xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1));
|
||||||
|
echo "getting:\n";
|
||||||
|
var_dump(xml_parser_get_option($parser, XML_OPTION_SKIP_TAGSTART));
|
||||||
|
var_dump(xml_parser_get_option($parser, XML_OPTION_SKIP_WHITE));
|
||||||
|
?>
|
||||||
|
--EXPECT--
|
||||||
|
defaults:
|
||||||
|
int(0)
|
||||||
|
int(0)
|
||||||
|
setting:
|
||||||
|
bool(true)
|
||||||
|
bool(true)
|
||||||
|
getting:
|
||||||
|
int(7)
|
||||||
|
int(1)
|
|
@ -1662,6 +1662,12 @@ PHP_FUNCTION(xml_parser_get_option)
|
||||||
case PHP_XML_OPTION_CASE_FOLDING:
|
case PHP_XML_OPTION_CASE_FOLDING:
|
||||||
RETURN_LONG(parser->case_folding);
|
RETURN_LONG(parser->case_folding);
|
||||||
break;
|
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:
|
case PHP_XML_OPTION_TARGET_ENCODING:
|
||||||
RETURN_STRING((char *)parser->target_encoding);
|
RETURN_STRING((char *)parser->target_encoding);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue