|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #63506 Adding openStream() method to XMLWriter
Submitted: 2012-11-13 18:26 UTC Modified: -
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: evert at rooftopsolutions dot nl Assigned:
Status: Open Package: XML Writer
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: evert at rooftopsolutions dot nl
New email:
PHP Version: OS:


 [2012-11-13 18:26 UTC] evert at rooftopsolutions dot nl
It would be extremely handy if, instead of supplying XMLWriter with a uri, we can give it a writeable stream instead, as such;

$h  = fopen('php://output','w');
$xw = new \XMLWriter();

This way the XMLWriter does not have to be aware of an output uri.

In my applications (webservices) I simply work with out an output, and an input stream. Different components write to the outputstream, and what they are writing comes from different sources.

Unittests often simply replace the outputstream with php://memory, or php://temp, so the application output can get easily redirected.

Using openUri() I have to break this, which would kind of suck.


Add a Patch

Pull Requests

Add a Pull Request

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Jun 07 10:03:41 2023 UTC