forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbug64230.phpt
48 lines (36 loc) · 938 Bytes
/
bug64230.phpt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
--TEST--
Bug #64230 (XMLReader does not suppress errors)
--EXTENSIONS--
xmlreader
--FILE--
<?php
echo "Test\n";
function show_internal_errors() {
foreach (libxml_get_errors() as $error) {
printf("Internal: %s\n", $error->message);
}
libxml_clear_errors();
}
echo "Internal errors TRUE\n";
libxml_use_internal_errors(true);
$x = new XMLReader;
$x->xml("<root att/>");
$x->read();
show_internal_errors();
echo "Internal errors FALSE\n";
libxml_use_internal_errors(false);
$x = new XMLReader;
$x->xml("<root att/>");
$x->read();
show_internal_errors();
?>
Done
--EXPECTF--
Test
Internal errors TRUE
Internal: Specification mandate%A value for attribute att
Internal errors FALSE
Warning: XMLReader::read(): %s: parser error : Specification mandate%A value for attribute att in %s on line %d
Warning: XMLReader::read(): <root att/> in %s on line %d
Warning: XMLReader::read(): ^ in %s on line %d
Done