facebook / facebook/hhvm

Cannot catch querypath parser errors

Open
#6,982 1 comment 0 reactions 0 assignees View on GitHub
no isolated repro php5 incompatibility php7 incompatibility probably easy
Dominant language
C++
Stars
18.7k
Forks
3.1k
Avg merge
1h 47m
Merged PRs (30d)
2

Description

### HHVM Version

3.14.0-dev
### Standalone code, or other way to reproduce the problem

```
This is invalid HTML <
HTML;

function errorHandler($errno, $errstr) {
var_dump('handling error', $errno, $errstr);
}

set_error_handler('errorHandler', E_ERROR | E_WARNING | E_USER_ERROR | E_USER_WARNING);

$qp->html($h);
```
### Expected result

In Zend, the error handler gets called 4 times:

```
string(14) "handling error"
int(2)
string(95) "DOMDocumentFragment::appendXML(): Entity: line 1: parser error : StartTag: invalid element name"
string(14) "handling error"
int(2)
string(68) "DOMDocumentFragment::appendXML():

This is invalid HTML <
"
string(14) "handling error"
int(2)
string(62) "DOMDocumentFragment::appendXML(): ^"
string(14) "handling error"
int(2)
string(91) "DOMDocumentFragment::appendXML(): Entity: line 1: parser error : chunk is not well balanced"
```
### Actual result

In HHVM, it gets called 0 times:

```
Entity: line 1: parser error : StartTag: invalid element name

This is invalid HTML <

^
Entity: line 1: parser error : chunk is not well balanced
```

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.