1--TEST--
2XMLWriter::toMemory() with combinations of empty flush and non-empty flush
3--EXTENSIONS--
4xmlwriter
5--FILE--
6<?php
7
8$writer = XMLWriter::toMemory();
9var_dump($writer->flush(empty: false));
10$writer->startElement('foo');
11var_dump($writer->flush(empty: false));
12$writer->endElement();
13var_dump($writer->flush(empty: false));
14var_dump($writer->flush());
15var_dump($writer->flush());
16
17?>
18--EXPECT--
19string(0) ""
20string(4) "<foo"
21string(6) "<foo/>"
22string(6) "<foo/>"
23string(0) ""
24