1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
--TEST--
XMLWriter::toStream() - custom constructor
--EXTENSIONS--
xmlwriter
--FILE--
<?php
class CustomXMLWriter extends XMLWriter {
public int $myField;
public function __construct() {
$this->myField = 1234;
echo "hello world\n";
}
}
$h = fopen("php://output", "w");
$writer = CustomXMLWriter::toStream($h);
var_dump($writer);
$writer->startElement("root");
$writer->endElement();
$writer->flush();
?>
--EXPECTF--
hello world
object(CustomXMLWriter)#%d (1) {
["myField"]=>
int(1234)
}
<root/>
|