xref: /PHP-7.4/ext/xml/tests/bug73135.phpt (revision 80a377e6)
1--TEST--
2Bug #73135 (xml_parse() segmentation fault)
3--SKIPIF--
4<?php if (!extension_loaded('xml')) die('skip xml extension not loaded'); ?>
5--CREDITS--
6edgarsandi - <edgar.r.sandi@gmail.com>
7--FILE--
8<?php
9    function start_elem($parser, $xml) {
10        xml_parse($parser, $xml);
11    }
12
13    $xml = <<<HERE
14    <a xmlns="ahihi">
15        <bar foo="ahihi"/>
16    </a>
17HERE;
18
19    $parser = xml_parser_create_ns();
20    xml_set_element_handler($parser, 'start_elem', 'ahihi');
21    xml_parse($parser, $xml);
22?>
23--EXPECTF--
24Warning: xml_parse(): Parser must not be called recursively in %s%ebug73135.php on line %d
25
26Warning: xml_parse(): Parser must not be called recursively in %s%ebug73135.php on line %d
27
28Warning: xml_parse(): Unable to call handler ahihi() in %s%ebug73135.php on line %d
29
30Warning: xml_parse(): Unable to call handler ahihi() in %s%ebug73135.php on line %d
31