facebook / facebook/hhvm

XML_OPTION_SKIP_WHITE parameter being ignored

Open
#4,970 0 comments 0 reactions 0 assignees View on GitHub
php5 incompatibility
Dominant language
C++
Stars
18.7k
Forks
3.1k
Avg merge
1h 47m
Merged PRs (30d)
2

Description

It appears that the latest version of HHVM is no longer recognizing XML_OPTION_SKIP_WHITE

Take the following snippet:

```
$text = "\n";

$parser = xml_parser_create('');
xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
xml_parse_into_struct($parser, $text, $xml_values);
var_dump($xml_values);
```

The output in PHP 5.5 and 5.6:

```
array(3) {
[0]=>
array(3) {
["tag"]=>
string(4) "TEST"
["type"]=>
string(4) "open"
["level"]=>
int(1)
}
[1]=>
array(4) {
["tag"]=>
string(9) "TEST-FULL"
["type"]=>
string(8) "complete"
["level"]=>
int(2)
["attributes"]=>
array(2) {
["NAME"]=>
string(10) "helloworld"
["VALUE"]=>
string(1) "c"
}
}
[2]=>
array(3) {
["tag"]=>
string(4) "TEST"
["type"]=>
string(5) "close"
["level"]=>
int(1)
}
}
```

The output in HHVM:

```
array(4) {
[0]=>
array(3) {
["tag"]=>
string(4) "TEST"
["type"]=>
string(4) "open"
["level"]=>
int(1)
}
[1]=>
array(4) {
["tag"]=>
string(4) "TEST"
["value"]=>
string(1) "
"
["type"]=>
string(5) "cdata"
["level"]=>
int(1)
}
[2]=>
array(4) {
["tag"]=>
string(9) "TEST-FULL"
["type"]=>
string(8) "complete"
["level"]=>
int(2)
["attributes"]=>
array(2) {
["NAME"]=>
string(10) "helloworld"
["VALUE"]=>
string(1) "c"
}
}
[3]=>
array(3) {
["tag"]=>
string(4) "TEST"
["type"]=>
string(5) "close"
["level"]=>
int(1)
}
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.