xref: /PHP-8.2/ext/xml/tests/bug72793.phpt (revision 8567bc10)
1--TEST--
2Bug #72793: xml_parser_free leaks mem when execute xml_set_object
3--EXTENSIONS--
4xml
5--FILE--
6<?php
7
8class xml  {
9    var $parser;
10
11    function __construct()
12    {
13        $this->parser = xml_parser_create();
14        xml_set_object($this->parser, $this);
15    }
16
17    function parse($data)
18    {
19        xml_parse($this->parser, $data);
20    }
21
22    function free(){
23        xml_parser_free($this->parser);
24    }
25}
26
27$xml_test = '<?xml version="1.0" encoding="utf-8"?><test></test>';
28$xml_parser = new xml();
29$xml_parser->parse($xml_test);
30$xml_parser->free();
31
32?>
33===DONE===
34--EXPECT--
35===DONE===
36