1--TEST-- 2XMLWriter: libxml2 XML Writer, file buffer, flush 3--SKIPIF-- 4<?php if (!extension_loaded("xmlwriter")) print "skip"; ?> 5--FILE-- 6<?php 7 8$doc_dest = '001.xml'; 9$xw = new XMLWriter(); 10$xw->openUri($doc_dest); 11$xw->startDocument('1.0', 'UTF-8', 'standalonearg'); 12$xw->startElement("tag1"); 13$xw->endDocument(); 14 15// Force to write and empty the buffer 16$output_bytes = $xw->flush(true); 17echo file_get_contents($doc_dest); 18unset($xw); 19unlink('001.xml'); 20?> 21===DONE=== 22--EXPECT-- 23<?xml version="1.0" encoding="UTF-8" standalone="standalonearg"?> 24<tag1/> 25===DONE=== 26