facebook / facebook/hhvm

Zend incompatibility: xml_set_element_handler() behaves differently

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

Description

To reproduce, use the following script (e.g. xml_parse.php):

``` php
";
}
function end_elem($parser,$name)
{
echo "";
}

$parser=xml_parser_create();
xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0);
xml_set_element_handler($parser,"start_elem","end_elem");
$buf = '';
echo xml_parse($parser,$buf,strlen($buf)==0);
```

then compare

``` bash
php xml_parse.php
```

Output: `1`

with

``` bash
hhvm --mode debug xml_parse.php
```

Run with r.

Output: `1`

It seems that start_elem() is somehow not called in the Zend implementation (maybe a bug there or is this intended?).

```
php --version
PHP 5.4.4-14+deb7u7 (cli) (built: Dec 12 2013 08:42:07)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
with XCache v2.0.0, Copyright (c) 2005-2012, by mOo
```

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.