1--TEST--
2XMLWriter::toStream() - normal usage
3--EXTENSIONS--
4xmlwriter
5--FILE--
6<?php
7
8$h = fopen("php://output", "w");
9
10$writer = XMLWriter::toStream($h);
11$writer->startElement("root");
12$writer->writeAttribute("align", "left");
13$writer->writeComment("hello");
14$writer->endElement();
15$amount = $writer->flush();
16echo "\nFlush amount: ";
17var_dump($amount);
18
19// Force destroying the held stream
20unset($writer);
21
22// Test that the stream wasn't closed or destroyed
23fwrite($h, "\nthis is the end\n");
24
25?>
26--EXPECT--
27<root align="left"><!--hello--></root>
28Flush amount: int(38)
29
30this is the end
31