mirror of
https://github.com/php/php-src.git
synced 2026-04-24 08:28:26 +02:00
e35a3cb28c
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.
30 lines
426 B
PHP
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===
|