Use zend_parse_parameters_none() in XmlWriter::openMemory()

And fix incorrect uses in tests
This commit is contained in:
Nikita Popov 2019-02-20 09:31:08 +01:00
parent 6e17fbefde
commit d94a1907b7
3 changed files with 6 additions and 4 deletions

View File

@ -1700,6 +1700,10 @@ static PHP_FUNCTION(xmlwriter_open_memory)
zval *self = getThis();
ze_xmlwriter_object *ze_obj = NULL;
if (zend_parse_parameters_none() == FAILURE) {
return;
}
if (self) {
/* We do not use XMLWRITER_FROM_OBJECT, xmlwriter init function here */
ze_obj = Z_XMLWRITER_P(self);

View File

@ -5,8 +5,7 @@ XMLWriter: libxml2 XML Writer, membuffer, flush
--FILE--
<?php
$doc_dest = '002.xml';
$xw = xmlwriter_open_memory($doc_dest);
$xw = xmlwriter_open_memory();
xmlwriter_start_document($xw, '1.0', 'UTF-8');
xmlwriter_start_element($xw, "tag1");
xmlwriter_end_document($xw);

View File

@ -5,8 +5,7 @@ XMLWriter: libxml2 XML Writer, membuffer, flush, attribute
--FILE--
<?php
$doc_dest = '003.xml';
$xw = xmlwriter_open_memory($doc_dest);
$xw = xmlwriter_open_memory();
xmlwriter_start_document($xw, '1.0', 'UTF-8');
xmlwriter_start_element($xw, "tag1");