xref: /PHP-8.3/ext/xml/tests/gh14834.phpt (revision 0b6289da)
1--TEST--
2GH-14834 (Error installing PHP when --with-pear is used)
3--EXTENSIONS--
4xml
5--SKIPIF--
6<?php
7require __DIR__ . '/libxml_expat_skipif.inc';
8skipif(want_expat: false);
9?>
10--FILE--
11<?php
12$xml = <<<XML
13<?xml version="1.0" encoding="UTF-8"?>
14<!DOCTYPE root [
15    <!ENTITY foo "ent">
16]>
17<root>
18  <element hint="hello&apos;world">&foo;<![CDATA[ &amp; ]]><?x &amp; ?></element>
19</root>
20XML;
21
22$parser = xml_parser_create();
23xml_set_character_data_handler($parser, function($_, $data) {
24    var_dump($data);
25});
26xml_parse($parser, $xml, true);
27?>
28--EXPECT--
29string(3) "
30  "
31string(3) "ent"
32string(7) " &amp; "
33string(1) "
34"
35