"Fossies" - the Fresh Open Source Software Archive 
Member "php-8.0.28-src/ext/xmlwriter/tests/001.phpt" (14 Feb 2023, 530 Bytes) of package /windows/www/php-8.0.28-src.zip:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
1 --TEST--
2 XMLWriter: 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 = xmlwriter_open_uri($doc_dest);
10 xmlwriter_start_document($xw, '1.0', 'UTF-8');
11 xmlwriter_start_element($xw, "tag1");
12 xmlwriter_end_document($xw);
13
14 // Force to write and empty the buffer
15 $output_bytes = xmlwriter_flush($xw, true);
16 echo file_get_contents($doc_dest);
17 unset($xw);
18 unlink($doc_dest);
19 ?>
20 --EXPECT--
21 <?xml version="1.0" encoding="UTF-8"?>
22 <tag1/>