rfc:xmlreader_writer_streams
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
rfc:xmlreader_writer_streams [2024/04/24 19:30] – Update staticness nielsdos | rfc:xmlreader_writer_streams [2024/05/10 16:10] (current) – Add example usages of the new APIs. nielsdos | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== PHP RFC: Add openStream() to XML{Reader, | ====== PHP RFC: Add openStream() to XML{Reader, | ||
- | * Version: 0.9.1 | + | * Version: 0.9.2 |
* Date: 2024-04-21 | * Date: 2024-04-21 | ||
* Author: Niels Dossche < | * Author: Niels Dossche < | ||
Line 46: | Line 46: | ||
The third BC break is the promotion of the NULL-byte warning to a < | The third BC break is the promotion of the NULL-byte warning to a < | ||
+ | |||
+ | ===== Example usages ===== | ||
+ | |||
+ | ==== Minimal XMLReader example ==== | ||
+ | |||
+ | <PHP> | ||
+ | // Could be any stream, but this is for simplicity sake | ||
+ | $h = fopen(" | ||
+ | fwrite($h, "< | ||
+ | fseek($h, 0); | ||
+ | |||
+ | $reader = new XMLReader; | ||
+ | $reader-> | ||
+ | |||
+ | while ($reader-> | ||
+ | switch ($reader-> | ||
+ | case XMLReader:: | ||
+ | echo " | ||
+ | break; | ||
+ | case XMLReader:: | ||
+ | echo " | ||
+ | break; | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ==== Minimal XMLWriter example ==== | ||
+ | |||
+ | <PHP> | ||
+ | // Could be any stream, but this is for simplicity sake | ||
+ | $h = fopen(" | ||
+ | |||
+ | $writer = new XMLWriter; | ||
+ | $writer-> | ||
+ | |||
+ | $writer-> | ||
+ | $writer-> | ||
+ | $writer-> | ||
+ | $writer-> | ||
+ | $amount = $writer-> | ||
+ | echo " | ||
+ | var_dump($amount); | ||
+ | </ | ||
===== Proposed PHP Version(s) ===== | ===== Proposed PHP Version(s) ===== | ||
Line 95: | Line 138: | ||
===== Changelog ===== | ===== Changelog ===== | ||
+ | - 0.9.2: Add example usages of the new APIs. | ||
- 0.9.1: Made XMLReader:: | - 0.9.1: Made XMLReader:: | ||
- 0.9: Initial version under discussion | - 0.9: Initial version under discussion |
rfc/xmlreader_writer_streams.txt · Last modified: 2024/05/10 16:10 by nielsdos