xref: /PHP-8.0/ext/xmlwriter/tests/002.phpt (revision a555cc0b)
1--TEST--
2XMLWriter: libxml2 XML Writer, membuffer, flush
3--SKIPIF--
4<?php if (!extension_loaded("xmlwriter")) print "skip"; ?>
5--FILE--
6<?php
7
8$xw = xmlwriter_open_memory();
9xmlwriter_start_document($xw, '1.0', 'UTF-8');
10xmlwriter_start_element($xw, "tag1");
11xmlwriter_end_document($xw);
12
13// Force to write and empty the buffer
14echo xmlwriter_flush($xw, true);
15?>
16--EXPECT--
17<?xml version="1.0" encoding="UTF-8"?>
18<tag1/>
19