Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<XMLWriter::toMemoryXMLWriter::toUri>
^XMLWriterLast updated: Mon, 26 Oct 2026

XMLWriter::toStream

(PHP 8 >= 8.4.0)

XMLWriter::toStream — Create new XMLWriter using a stream for output

Description

public static function XMLWriter::toStream(resource $stream): static

Creates a new XMLWriter using a stream for output.

Parameters

stream

The stream to use for output.

Return Values

Returns an XMLWriter.

Errors/Exceptions

  • Passing a resource that is not a stream to stream will throw a TypeError.

See Also


<XMLWriter::toMemoryXMLWriter::toUri>
^XMLWriterLast updated: Mon, 26 Oct 2026