xref: /PHP-8.1/ext/xml/tests/bug76874.phpt (revision 8567bc10)
1--TEST--
2Bug #76874: xml_parser_free() should never leak memory
3--EXTENSIONS--
4xml
5--FILE--
6<?php
7
8class c
9{
10    private $xml;
11    private $test;
12
13    public function test()
14    {
15        $this->xml = xml_parser_create();
16        xml_set_character_data_handler($this->xml, array(&$this, 'handle_cdata'));
17        xml_parser_free($this->xml);
18    }
19
20    public function handle_cdata(&$parser, $data)
21    {
22    }
23}
24
25$object = new c();
26$object->test();
27
28?>
29===DONE===
30--EXPECT--
31===DONE===
32