1
0
mirror of https://github.com/php/php-src.git synced 2026-04-24 08:28:26 +02:00
Files
archived-php-src/ext/xml/tests/bug76874.phpt
T
Nikita Popov e35a3cb28c ext/xml: Use object instead of resource
Use an XmlParser object instead of a resource. This is an internal
representation change, not a conversion to OO APIs. XmlParser objects
cannot be explicitly constructed, they are created through the usual
xml_parser_* APIs.

This change allows us to provide a proper get_gc() implementation,
thus resolving bugs #72793 and #76874.

xml_parser_free() is a no-op now and need not be called anymore.
2019-04-08 16:23:13 +02:00

30 lines
426 B
PHP

--TEST--
Bug #76874: xml_parser_free() should never leak memory
--FILE--
<?php
class c
{
private $xml;
private $test;
public function test()
{
$this->xml = xml_parser_create();
xml_set_character_data_handler($this->xml, array(&$this, 'handle_cdata'));
xml_parser_free($this->xml);
}
public function handle_cdata(&$parser, $data)
{
}
}
$object = new c();
$object->test();
?>
===DONE===
--EXPECT--
===DONE===