2005-06-23 19:29:03 +08:00
|
|
|
--TEST--
|
|
|
|
XMLWriter: libxml2 XML Writer, membuffer, flush
|
|
|
|
--SKIPIF--
|
|
|
|
<?php if (!extension_loaded("xmlwriter")) print "skip"; ?>
|
|
|
|
--FILE--
|
2018-07-03 08:52:16 +08:00
|
|
|
<?php
|
2005-06-23 19:29:03 +08:00
|
|
|
|
|
|
|
$xw = new XMLWriter();
|
|
|
|
$xw->openMemory();
|
2005-08-07 02:23:40 +08:00
|
|
|
$xw->startDocument('1.0', 'UTF-8', 'standalone');
|
2005-06-23 19:29:03 +08:00
|
|
|
$xw->startElement("tag1");
|
|
|
|
$xw->endDocument();
|
|
|
|
|
|
|
|
// Force to write and empty the buffer
|
|
|
|
echo $xw->flush(true);
|
|
|
|
?>
|
2005-07-03 17:10:41 +08:00
|
|
|
===DONE===
|
2005-06-23 19:29:03 +08:00
|
|
|
--EXPECT--
|
2005-08-07 02:23:40 +08:00
|
|
|
<?xml version="1.0" encoding="UTF-8" standalone="standalone"?>
|
2005-06-23 19:29:03 +08:00
|
|
|
<tag1/>
|
2005-07-03 17:10:41 +08:00
|
|
|
===DONE===
|